Необходимо программно отслеживать регистрацию нового пользователя в системе. Я так понимаю, что реализовать это можно с использованием WMI. Теоретически. На практике - не знаю, как именно это сделать в данном случае. Программа разрабатывается на C++. Если кто-нибудь может помочь ссылкой / советом, буду искренне благодарен. Спасибо!
Нет. Там была простенькая апишка по перечислению пользователей. Сейчас поищу у себя в сорцах. --------------- ЗЫ: Количество папок в Document and Settings - как один из вариантов Создали пользователя - появилась новая папка. Удалили пользователя, - папка исчезла (хотя если кильнули пользователя, но сохранили профиль, тогда может быть сбой, но такое редко бывает. Либо пользователя бахают, либо нет) При чем реализуется даже с учетки гостя. Еще реализуется через обычный вывод net localgroup в буффер
Во Нашел NetUserEnum Код (Text): The NetUserEnum function provides information about all user accounts on a server. To quickly enumerate user, computer, or global group account information, call the NetQueryDisplayInformation function. NET_API_STATUS NetUserEnum( LPCWSTR servername, DWORD level, DWORD filter, LPBYTE* bufptr, DWORD prefmaxlen, LPDWORD entriesread, LPDWORD totalentries, LPDWORD resume_handle ); Parameters servername [in] Pointer to a constant string that specifies the DNS or NetBIOS name of the remote server on which the function is to execute. If this parameter is NULL, the local computer is used. Windows NT: This string must begin with \\. level [in] Specifies the information level of the data. This parameter can be one of the following values. Value Meaning 0 Return user account names. The bufptr parameter points to an array of USER_INFO_0 structures. 1 Return detailed information about user accounts. The bufptr parameter points to an array of USER_INFO_1 structures. 2 Return detailed information about user accounts, including authorization levels and logon information. The bufptr parameter points to an array of USER_INFO_2 structures. 3 Return detailed information about user accounts, including authorization levels, logon information, RIDs for the user and the primary group, and profile information. The bufptr parameter points to an array of USER_INFO_3 structures. 10 Return user and account names and comments. The bufptr parameter points to an array of USER_INFO_10 structures. 11 Return detailed information about user accounts. The bufptr parameter points to an array of USER_INFO_11 structures. 20 Return the user's name and identifier and various account attributes. The bufptr parameter points to an array of USER_INFO_20 structures. Note that on Windows XP and later, it is recommended that you use USER_INFO_23 instead. 23 Return the user's name and identifier and various account attributes. The bufptr parameter points to an array of USER_INFO_23 structures. Windows 2000/NT: This level is not supported. filter [in] Specifies a value that filters the account types for enumeration. A value of zero indicates all account types. This parameter can be one of the following values. Value Meaning FILTER_TEMP_DUPLICATE_ACCOUNT Enumerates local user account data on a domain controller. FILTER_NORMAL_ACCOUNT Enumerates global user account data on a computer. FILTER_INTERDOMAIN_TRUST_ACCOUNT Enumerates domain trust account data on a domain controller. The data is associated with the accounts of domains trusting the specified domain. FILTER_WORKSTATION_TRUST_ACCOUNT Enumerates workstation or member server account data on a domain controller. FILTER_SERVER_TRUST_ACCOUNT Enumerates domain controller account data on a domain controller. bufptr [out] Pointer to the buffer that receives the data. The format of this data depends on the value of the level parameter. This buffer is allocated by the system and must be freed using the NetApiBufferFree function. Note that you must free the buffer even if the function fails with ERROR_MORE_DATA. prefmaxlen [in] Specifies the preferred maximum length, in 8-bit bytes of returned data. If you specify MAX_PREFERRED_LENGTH, the function allocates the amount of memory required for the data. If you specify another value in this parameter, it can restrict the number of bytes that the function returns. If the buffer size is insufficient to hold all entries, the function returns ERROR_MORE_DATA. For more information, see Network Management Function Buffers and Network Management Function Buffer Lengths. entriesread [out] Pointer to a value that receives the count of elements actually enumerated. totalentries [out] Pointer to a value that receives the total number of entries that could have been enumerated from the current resume position. Note that applications should consider this value only as a hint. If your application is communicating with a Windows 2000 or later domain controller, you should consider using the ADSI LDAP Provider to retrieve this type of data more efficiently. The ADSI LDAP Provider implements a set of ADSI objects that support various ADSI interfaces. For more information, see ADSI Service Providers. LAN Manager: If the call is to a computer that is running LAN Manager 2.x, the totalentries parameter will always reflect the total number of entries in the database no matter where it is in the resume sequence. resume_handle [in, out] Pointer to a value that contains a resume handle which is used to continue an existing user search. The handle should be zero on the first call and left unchanged for subsequent calls. If resume_handle is NULL, then no resume handle is stored. Return Values If the function succeeds, the return value is NERR_Success. If the function fails, the return value can be one of the following error codes. Return code Description ERROR_ACCESS_DENIED The user does not have access to the requested information. NERR_InvalidComputer The computer name is invalid. ERROR_MORE_DATA More entries are available. Specify a large enough buffer to receive all entries. Remarks If you are programming for Active Directory, you may be able to call certain Active Directory Service Interface (ADSI) methods to achieve the same functionality you can achieve by calling the network management user functions. For more information, see IADsUser and IADsComputer. If you call this function on a domain controller that is running Active Directory, access is allowed or denied based on the access control list (ACL) for the securable object. The default ACL permits all authenticated users and members of the "Pre-Windows 2000 compatible access" group to view the information. If you call this function on a member server or workstation, all authenticated users can view the information. For information about anonymous access and restricting anonymous access on these platforms, see Security Requirements for the Network Management Functions. For more information on ACLs, ACEs, and access tokens, see Access Control Model. Windows NT: No special group membership is required to successfully execute the NetUserEnum function. The function only returns information to which the caller has Read access. The caller must have List Contents access to the Domain object, and Enumerate Entire SAM Domain access on the SAM Server object located in the System container. To retrieve the names and SIDs of domains trusted by a Local Security Authority (LSA) policy object, call the LsaEnumerateTrustedDomains function. The NetUserEnum function does not return all system users. It returns only those users who have been added with a call to the NetUserAdd function. There is no guarantee that the list of users will be returned in sorted order. If you call NetUserEnum and specify information level 1, 2, or 3, the password member of each structure is set to NULL to maintain password security. User account names are limited to 20 characters and group names are limited to 256 characters. In addition, account names cannot be terminated by a period and they cannot include commas or any of the following printable characters: ", /, \, [, ], :, |, <, >, +, =, ;, ?, *. Names also cannot include characters in the range 1-31, which are nonprintable.
исходя из http://www.google.ru/search?hl=ru&q=wmi+event+register+user&btnG=%D0%9F%D0%BE%D0%B8%D1%81%D0%BA&lr= вторая ссылка ведет на http://msdn2.microsoft.com/en-us/library/aa393013.aspx там есть vbs пример помотри его в аттаче пример работы с WMI
А в асме можно как-нибуть с вмиай'ем подружиться? Или как еще можно обращение к sam-файлу или лдап'у выполнить?