Get a single or multiple groups in an Azure DevOps organization.
Get-AdoGroup [-CollectionUri <string>] [-ScopeDescriptor <string>] [-SubjectTypes <string[]>]
[-Name <string[]>] [-Version <string>] [<CommonParameters>]Get-AdoGroup [-CollectionUri <string>] [-GroupDescriptor <string>] [-Version <string>]
[<CommonParameters>]This cmdlet has the following aliases,
- N/A
This function retrieves a single or multiple groups in an Azure DevOps organization through REST API.
Get-AdoGroupRetrieves all groups in the Azure DevOps organization.
$project = Get-AdoProject -Name 'my-project-1'
$projectDescriptor = (Get-AdoDescriptor -StorageKey $project.Id)
$params = @{
CollectionUri = 'https://dev.azure.com/my-org'
ScopeDescriptor = $projectDescriptor
SubjectTypes = 'vssgp'
}
Get-AdoGroup @paramsRetrieves all groups in the specified project with subject types 'vssgp'.
$params = @{
SubjectTypes = 'vssgp'
ScopeDescriptor = $projectDescriptor
Name = @(
'Project Administrators',
'Contributors'
)
}
Get-AdoGroup @paramsRetrieves the 'Project Administrators' and 'Contributors' groups in the specified scope with subject types 'vssgp'.
@(
'vssgp.00000000-0000-0000-0000-000000000000',
'vssgp.00000000-0000-0000-0000-000000000001',
'vssgp.00000000-0000-0000-0000-000000000002'
) | Get-AdoGroupRetrieves the groups with the specified descriptors.
Optional. The collection URI of the Azure DevOps collection/organization, e.g., https://vssps.dev.azure.com/my-org.
Type: System.String
DefaultValue: $env:DefaultAdoCollectionUri
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: true
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''Optional. The descriptor of a specific group to retrieve. When provided, retrieves a single group by its descriptor.
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: ByDescriptor
Position: Named
IsRequired: false
ValueFromPipeline: true
ValueFromPipelineByPropertyName: true
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''Optional. A group's display name to filter the retrieved results. Supports wildcards for pattern matching.
Type: System.String[]
DefaultValue: ''
SupportsWildcards: false
Aliases:
- DisplayName
- GroupName
ParameterSets:
- Name: ListGroups
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: true
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''Optional. Specify a non-default scope (collection, project) to search for groups.
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: ListGroups
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: true
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''Optional. A comma separated list of user subject subtypes to reduce the retrieved results, e.g. Microsoft.IdentityModel.Claims.ClaimsIdentity
Type: System.String[]
DefaultValue: "@('vssgp', 'aadgp')"
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: ListGroups
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: true
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''Optional. The API version to use for the request. Default is '7.2-preview.1'. The -preview flag must be supplied in the api-version for this request to work.
Type: System.String
DefaultValue: 7.2-preview.1
SupportsWildcards: false
Aliases:
- ApiVersion
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues:
- 7.1-preview.1
- 7.2-preview.1
HelpMessage: The -preview flag must be supplied in the api-version for this request to work.This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
- N/A
- Retrieves groups in an Azure DevOps organization
- Requires authentication to Azure DevOps. Use
Set-AdoDefaultto configure default organization and project values. - The cmdlet automatically retrieves authentication through
Invoke-AdoRestMethodwhich callsNew-AdoAuthHeader.