Get-MSAzureUserGroupMembership
    • 21 Aug 2024
    • 1 Minute to read
    • Dark
      Light
    • PDF

    Get-MSAzureUserGroupMembership

    • Dark
      Light
    • PDF

    Article summary

    Return the groups that a user is a member of from Azure AD.

    Syntax

    Get-MSAzureUserGroupMembership
      -ID  <String>
      -Transitive
      -Properties  <String>
      -Filter  <String>
      -TenantName  <String>
      -TotalCount
      -HideProgressBar
      -AuthToken  <String>
      -ResultSize  <Int32>
      -ProgressUpdateFreq  <Int32>
    

    Examples

    Example 1

    Get-MSAzureUserGroupMembership -ID abcdefab-1234-1234-1234-abcdabcdabcd
    

    Returns the groups that the selected user is a member of

    Example 2

    Get-MSAzureUser -Properties 'id,userPrincipalName' -AuthToken $AuthToken
    

    Returns a list of Azure users' ID and userPrincipalNames using a previously-obtained authtoken

    Parameters

    -ID <String>
    The Azure AD GUID of the user

    ParameterValue
    Requiredtrue
    Position1
    Requiredtrue
    Default ValueNone
    Accept pipeline input?true (ByPropertyName)
    Accept wildcard characters?false

    -Transitive <SwitchParameter>
    Show groups where the user is a member of a group that is a member of another group

    ParameterValue
    Requiredfalse
    Positionnamed
    Requiredfalse
    Default ValueFalse
    Accept pipeline input?false
    Accept wildcard characters?false

    -Properties <String>
    A comma-delimited list of properties to return in the results
    Format as per https://docs.microsoft.com/en-us/graph/query-parameters?view=graph-rest-1.0#select-parameter
    Available properties can be found at https://docs.microsoft.com/en-us/graph/api/resources/group?view=graph-rest-1.0#properties

    ParameterValue
    Requiredfalse
    Position2
    Requiredfalse
    Default ValueNone
    Accept pipeline input?false
    Accept wildcard characters?false

    -Filter <String>
    Add filter parameters as per https://docs.microsoft.com/en-us/graph/query-parameters?context=graph%2Fapi%2F1.0&view=graph-rest-1.0#filter-parameter
    Available properties can be found at https://docs.microsoft.com/en-us/graph/api/resources/group?view=graph-rest-1.0#properties

    ParameterValue
    Requiredfalse
    Position3
    Requiredfalse
    Default ValueNone
    Accept pipeline input?false
    Accept wildcard characters?false

    -TenantName <String>
    The name of the Nectar DXP tenant. Used in multi-tenant configurations.

    ParameterValue
    Requiredfalse
    Position4
    Requiredfalse
    Default ValueNone
    Accept pipeline input?true (ByPropertyName)
    Accept wildcard characters?false

    -TotalCount <SwitchParameter>
    Only return a total count of objects

    ParameterValue
    Requiredfalse
    Positionnamed
    Requiredfalse
    Default ValueFalse
    Accept pipeline input?false
    Accept wildcard characters?false

    -HideProgressBar <SwitchParameter>

    ParameterValue
    Requiredfalse
    Positionnamed
    Requiredfalse
    Default ValueFalse
    Accept pipeline input?false
    Accept wildcard characters?false

    -AuthToken <String>
    The authorization token used for this request. Normally obtained via Get-MSGraphAccessToken

    ParameterValue
    Requiredfalse
    Position5
    Requiredfalse
    Default ValueNone
    Accept pipeline input?true (ByPropertyName)
    Accept wildcard characters?false

    -ResultSize <Int32>
    The number of results to return. Defaults to 10000.

    ParameterValue
    Requiredfalse
    Position6
    Requiredfalse
    Default Value10000
    Accept pipeline input?false
    Accept wildcard characters?false

    -ProgressUpdateFreq <Int32>

    ParameterValue
    Requiredfalse
    Position7
    Requiredfalse
    Default Value1
    Accept pipeline input?false
    Accept wildcard characters?false

    Was this article helpful?

    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.
    ESC

    Eddy AI, facilitating knowledge discovery through conversational intelligence