Add ToLocalGroup - PPOSHGROUP/PPoShTools GitHub Wiki
PPoShTools -> Add-ToLocalGroup.ps1
Adds a user or a group to local administrators of a remote computer
Add-ToLocalGroup [-ComputerName] <String[]> [-Group] <String> [[-DomainName]
<String>] [-Type] <String> [-Identity] <String> [<CommonParameters>]
Destination computer name where to add user or group (Identity parameter).
- DefaultValue: localhost
- PipelineInput: false
- Required: true
Destination local group the Identity should be added to.
- PipelineInput: false
- Required: true
Domain name - required for user/group string creation. Can be a workgroup or local computer name instead of domain name.
- PipelineInput: false
- Required: false
Type of identity to add - user or group.
- Valid values: User, Group
- PipelineInput: false
- Required: true
Identity of a user/group to add. Provide samaccountname
- PipelineInput: false
- Required: true
This will add 'someuser' to 'somecomputer' as local administrator for default domain Objectivity
Add-ToLocalGroup -ComputerName 'somecomputer' -Group Administrators -Type User -Identity 'someuser'