Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
Get-AzADGroup
- Module:
- Az.Resources Module
Lists entities from groups or get entity from groups by key
Syntax
EmptyParameterSet (Default)
Get-AzADGroup
[-Count]
[-Expand <String[]>]
[-Select <String[]>]
[-Filter <String>]
[-Orderby <String[]>]
[-Search <String>]
[-ConsistencyLevel <String>]
[-First <UInt64>]
[-Skip <UInt64>]
[-AppendSelected]
[-DefaultProfile <PSObject>]
[-CountVariable <String>]
[<CommonParameters>]
DisplayNameParameterSet
Get-AzADGroup
-DisplayName <String>
[-Expand <String[]>]
[-Select <String[]>]
[-ConsistencyLevel <String>]
[-First <UInt64>]
[-Skip <UInt64>]
[-AppendSelected]
[-DefaultProfile <PSObject>]
[<CommonParameters>]
SearchStringParameterSet
Get-AzADGroup
-DisplayNameStartsWith <String>
[-Expand <String[]>]
[-Select <String[]>]
[-ConsistencyLevel <String>]
[-First <UInt64>]
[-Skip <UInt64>]
[-AppendSelected]
[-DefaultProfile <PSObject>]
[<CommonParameters>]
ObjectIdParameterSet
Get-AzADGroup
-ObjectId <Guid>
[-Expand <String[]>]
[-Select <String[]>]
[-ConsistencyLevel <String>]
[-AppendSelected]
[-DefaultProfile <PSObject>]
[<CommonParameters>]
Description
Lists entities from groups or get entity from groups by key
Examples
Example 1: Get group by display name
Get-AzADGroup -DisplayName $gname
Get group by display name
Example 2: List groups
Get-AzADGroup -First 10
List first 10 groups
Example 3: Get group by object id
Get-AzADGroup -ObjectId $id -Select groupTypes -AppendSelected
Get group by object id and append property 'groupTypes' after default properties: 'DisplayName', 'Id', 'DeletedDateTime', 'SecurityEnabled', 'MailEnabled', 'MailNickname', 'Description'
Example 4: Get group with filter
Get-AzADGroup -Filter "startsWith(DisplayName,'some-name')"
Get group with filter
Example 5: Assign OdataCount to a variable
Get-AzADGroup -First 10 -ConsistencyLevel eventual -Count -CountVariable 'result'
$result
Assign OdataCount to a variable
Parameters
-AppendSelected
Append properties selected with default properties when this switch is on, only works with parameter '-Select'.
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-ConsistencyLevel
Indicates the requested consistency level. Documentation URL: https://developer.microsoft.com/en-us/office/blogs/microsoft-graph-advanced-queries-for-directory-objects-are-now-generally-available/
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-Count
Include count of items
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-CountVariable
Specifies a count of the total number of items in a collection. By default, this variable will be set in the global scope.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-DefaultProfile
The credentials, account, tenant, and subscription used for communication with Azure.
Parameter properties
| Type: | PSObject |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | AzContext, AzureRmContext, AzureCredential |
Parameter sets
-DisplayName
The display name of the group.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-DisplayNameStartsWith
Used to find groups that begin with the provided string.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | SearchString |
Parameter sets
-Expand
Expand related entities
Parameter properties
| Type: | String[] |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-Filter
Filter items by property values, for more detail about filter query please see: https://learn.microsoft.com/en-us/graph/filter-query-parameter
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-First
Gets only the first 'n' objects.
Parameter properties
| Type: | UInt64 |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-ObjectId
key: id of group
Parameter properties
| Type: | Guid |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-Orderby
Order items by property values
Parameter properties
| Type: | String[] |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-Search
Search items by search phrases
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-Select
Select properties to be returned
Parameter properties
| Type: | String[] |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-Skip
Ignores the first 'n' objects and then gets the remaining objects.
Parameter properties
| Type: | UInt64 |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
CommonParameters
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.
Outputs
IMicrosoftGraphGroup
Azure PowerShell
Feedback
Was this page helpful?
