Skip to content

Latest commit

 

History

History
95 lines (69 loc) · 2.26 KB

Get-AzureADServicePrincipalMembership.md

File metadata and controls

95 lines (69 loc) · 2.26 KB
external help file Module Name online version schema
Microsoft.Open.AzureAD16.Graph.PowerShell.dll-Help.xml
AzureAD
2.0.0

Get-AzureADServicePrincipalMembership

SYNOPSIS

Get a service principal membership.

SYNTAX

Get-AzureADServicePrincipalMembership -ObjectId <String> [-All <Boolean>] [-Top <Int32>] [<CommonParameters>]

DESCRIPTION

The Get-AzureADServicePrincipalMembership cmdlet gets the memberships of a service principal in Azure Active Directory (Azure AD).

EXAMPLES

Example 1: Retrieve the memberships of a service principal

PS C:\> $ServicePrincipalId = (Get-AzureADServicePrincipal -Top 1).ObjectId
PS C:\> Get-AzureADServicePrincipalMembership -ObjectId $ServicePrincipalId

The first command gets the ID of a service principal by using the Get-AzureADServicePrincipal (./Get-AzureADServicePrincipal.md)cmdlet. The command stores the ID in the $ServicePrincipalId variable.

The second command gets the memberships of a service principal identified by $ServicePrincipalId.

PARAMETERS

-All

If true, return all memberships. If false, return the number of objects specified by the Top parameter

Type: Boolean
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False

-ObjectId

Specifies the ID of a service principal in Azure AD.

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False

-Top

Specifies the maximum number of records to return.

Type: Int32
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
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

NOTES

RELATED LINKS

Get-AzureADServicePrincipal