UsrMgr_RemoveUserFromLocalGroup
Description
Section titled “Description”Removes a specified user from a local group.
The function doesn’t fail if the user isn’t a member of the group or if the group doesn’t exist. To check the result, use UsrMgr_IsUserMemberOfLocalGroup.
Syntax
Section titled “Syntax”UsrMgr_RemoveUserFromLocalGroup(sDomainName, sUserName, sGroupName) As Boolean
Parameters
Section titled “Parameters”sDomainName (String)
Section titled “sDomainName (String)”Where the user account is located: a domain name for a domain user, or the local computer name (gsWorkstationName) for a local user. Ignored when sUserName is INTERACTIVE or S-1-5-4.
sUserName (String)
Section titled “sUserName (String)”Name of the user to remove. To remove the built-in INTERACTIVE group, specify INTERACTIVE or its SID S-1-5-4.
sGroupName (String)
Section titled “sGroupName (String)”Name or SID of the local group to remove the user from. The name isn’t case sensitive.
Example
Section titled “Example”If bStatus Then bStatus = UsrMgr_RemoveUserFromLocalGroup("Domain", "Username", "Group")Related functions
Section titled “Related functions”UsrMgr_AddUserToLocalGroup UsrMgr_IsUserMemberOfLocalGroup Constants Package Property Variables