| 
            
              UserInfoRemoveUserFromLocalGroup Method
             | 
          
        
        
            Removes an existing user from the specified local groupName.
            
        
        Namespace: GSF.IdentityAssembly: GSF.Core (in GSF.Core.dll) Version: 2.4.257-beta+00aa2366fbb9ec75f636ebc7cfa610e3826a727c
Syntaxpublic static bool RemoveUserFromLocalGroup(
	string groupName,
	string userName
)
Public Shared Function RemoveUserFromLocalGroup ( 
	groupName As String,
	userName As String
) As Boolean
public:
static bool RemoveUserFromLocalGroup(
	String^ groupName, 
	String^ userName
)
static member RemoveUserFromLocalGroup : 
        groupName : string * 
        userName : string -> bool GSF.Identity.UserInfo.RemoveUserFromLocalGroup = function(groupName, userName);
 View SourceParameters
- groupName  String
 - Group name to remove local user from.
 - userName  String
 - Existing local user name.
 
Return Value
Booleantrue if user was removed from local group; otherwise, 
false meaning user did not exist in group.
Exceptions| Exception | Condition | 
|---|
| ArgumentNullException | groupName or userName was null. | 
| ArgumentException | No groupName or userName was specified. | 
| InvalidOperationException | Could not remove user from local group. | 
Remarks
            This function will handle Windows service virtual accounts by specifying the complete virtual account name,
            such as @"NT SERVICE\MyService", as the userName. This function can also remove
            Active Directory user accounts and groups from the local group the when the userName is
            prefixed with a domain name and a backslash "\".
            
See Also