Calling NetUserSetGroups API in VB.Net
-
How do i call NetUserSetGroups ( in netapi32.dll ) in VB.Net ? The prototype of NetUserSetGroups is as given below. NET_API_STATUS NetUserSetGroups( LPCWSTR servername, LPCWSTR username, DWORD level, LPBYTE buf, DWORD num_entries ); Parameters ( from MSDN ) 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. username [in] Pointer to a constant string that specifies the name of the user for which to set global group memberships. For more information, see the following Remarks section. level [in] Specifies the information level of the data. This parameter can be the following value. Value Meaning 0 The buf parameter points to an array of GROUP_USERS_INFO_0 structures that specifies global group names. The GROUP_USERS_INFO_0 structure contains global group member information. typedef struct _GROUP_USERS_INFO_0 { LPWSTR grui0_name; } GROUP_USERS_INFO_0, *PGROUP_USERS_INFO_0, *LPGROUP_USERS_INFO_0; buf [in] Pointer to the buffer that specifies the data. num_entries [in] Specifies the number of entries contained in the array pointed to by the buf parameter. Thanks in advance. Ashik