CmdID / PowerShell / Cmdlets / Add
Add-LocalGroupMember
Adds members to a local group. PowerShell reference
From the PowerShell reference
6 parameters
Alias algm
3 Sigma rules look for it
What it does
Adds members to a local group. The Add-LocalGroupMember cmdlet adds users or groups to a local security group. All the rights and permissions that are assigned to a group are assigned to all members of that group. Members of the Administrators group on a local computer have Full Control permissions on that computer. Limit the number of users in the Administrators group. If the computer is joined to a domain, you can add user accounts, computer accounts, and group accounts from that domain and from trusted domains to a local group. NOTE: If the computer is joined to a domain and you try to add a local user that has the same name as a member of the domain it adds the domain member.
Add-LocalGroupMember [-Group] <LocalGroup> [-Member] <LocalPrincipal[]> [-WhatIf] [-Confirm] [<CommonParameters>]Add-LocalGroupMember [-Member] <LocalPrincipal[]> [-Name] <String> [-WhatIf] [-Confirm] [<CommonParameters>]Add-LocalGroupMember [-Member] <LocalPrincipal[]> [-SID] <SecurityIdentifier> [-WhatIf] [-Confirm] [<CommonParameters>]
Add members to the Administrators group
Add-LocalGroupMember -Group "Administrators" -Member "Admin02", "MicrosoftAccount\username@Outlook.com", "AzureAD\DavidChew@contoso.com", "CONTOSO\Domain Admins"IdentifyIts page in the reference: Add-LocalGroupMember.
Parameters
-GroupSpecifies the security group to which this cmdlet adds members.-MemberSpecifies an array of users or groups that this cmdlet adds to a security group. You can specify users or groups by name, security ID (SID), or LocalPrincipal objects.-NameSpecifies the name of the security group to which this cmdlet adds members.-SIDSpecifies the security ID of the security group to which this cmdlet adds members.-ConfirmPrompts you for confirmation before running the cmdlet.-WhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.