CmdID

CmdID / PowerShell / Cmdlets / Remove

Remove-LocalGroupMember

Removes members from a local group. PowerShell reference

From the PowerShell reference 6 parameters Alias rlgm

Opens CmdID with your command, read as PowerShell. It is read in your browser and sent nowhere.

What it does

from the PowerShell reference, CC BY 4.0

Removes members from a local group. The Remove-LocalGroupMember cmdlet removes users or groups from a local group. NOTE: The Microsoft.PowerShell.LocalAccounts module is not available in 32-bit PowerShell on a 64-bit system.

Remove-LocalGroupMember [-Group] <LocalGroup> [-Member] <LocalPrincipal[]> [-WhatIf] [-Confirm] [<CommonParameters>]
Remove-LocalGroupMember [-Member] <LocalPrincipal[]> [-Name] <String> [-WhatIf] [-Confirm] [<CommonParameters>]
Remove-LocalGroupMember [-Member] <LocalPrincipal[]> [-SID] <SecurityIdentifier> [-WhatIf] [-Confirm] [<CommonParameters>]

Remove members from the Administrators group

$members = "Admin02", "MicrosoftAccount\username@Outlook.com", "AzureAD\DavidChew@contoso.com", "CONTOSO\Domain Admins" Remove-LocalGroupMember -Group "Administrators" -Member $membersIdentify

Its page in the reference: Remove-LocalGroupMember.

Parameters

6 in the PowerShell reference
-GroupSpecifies the security group from which this cmdlet removes members.
-MemberSpecifies an array of users or groups that this cmdlet removes from a security group. You can specify users or groups by name, security ID (SID), or LocalPrincipal objects. Specify SID strings in S-R-I-S-S . . . format.
-NameSpecifies the name of the security group from which this cmdlet removes members.
-SIDSpecifies the security ID of the security group from which this cmdlet removes members.
-ConfirmPrompts you for confirmation before running the cmdlet.
-WhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.