Get-Group
SYNOPSIS
Gets the groups on the local machine, returning a list of ADSI objects.
SYNTAX
Get-Group [[-Name] <String>] [-ProgressAction <ActionPreference>] [<CommonParameters>]
DESCRIPTION
This function will return a list of groups on the local machine. If a name is specified then only the group with that name will be returned.
EXAMPLES
EXAMPLE 1
This will return the Administrators group.
Get-Group -Name 'Administrators';
```powershell
### EXAMPLE 2
This will return all groups on the local machine.
Get-Group;
## PARAMETERS
### -Name
The name of the group to retrieve, if not specified all groups will be returned.
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ProgressAction
{{ Fill ProgressAction Description }}
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
INPUTS
OUTPUTS
[ADSI[]] - A list of ADSI objects representing the groups on the local machine.
NOTES
This function is designed to work with the ADSI provider for the local machine. It will not work with remote machines or other providers.