Skip to content

UsrMgr_RemoveUserFromLocalGroup

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.

UsrMgr_RemoveUserFromLocalGroup(sDomainName, sUserName, sGroupName) As Boolean

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.

Name of the user to remove. To remove the built-in INTERACTIVE group, specify INTERACTIVE or its SID S-1-5-4.

Name or SID of the local group to remove the user from. The name isn’t case sensitive.

If bStatus Then bStatus = UsrMgr_RemoveUserFromLocalGroup("Domain", "Username", "Group")

Scripting Guidelines

UsrMgr_AddUserToLocalGroup UsrMgr_IsUserMemberOfLocalGroup Constants Package Property Variables