Get-​Msol​Service​Principal​Credential

Gets credentials associated with a service principal.

Syntax

Get-MsolServicePrincipalCredential
   -AppPrincipalId <Guid>
   [-TenantId <Guid>]
   -ReturnKeyValues <Boolean>
   [<CommonParameters>]
Get-MsolServicePrincipalCredential
   -ObjectId <Guid>
   [-TenantId <Guid>]
   -ReturnKeyValues <Boolean>
   [<CommonParameters>]
Get-MsolServicePrincipalCredential
   -ServicePrincipalName <String>
   [-TenantId <Guid>]
   -ReturnKeyValues <Boolean>
   [<CommonParameters>]

Description

The Get-MsolServicePrincipalCredential cmdlet gets credentials that are associated with a service principal.

Examples

Example 1: Get credential properties

PS C:\> Get-MsolServicePrincipalCredential -ServicePrincipalName "MyApp/myApp.com"

This command gets all the credential properties, except the credential value, that are associated with the service principal name (SPN) MyApp/myApp.com. An SPN must follow the format appClass/hostname, where appClass represents the application class ("MyApp") and hostname represents the hostname for the application (myApp.com).

Required Parameters

-AppPrincipalId

Specifies the application ID of the service principal for which to get credentials.

Type:Guid
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ObjectId

Specifies the unique object ID of the service principal for which to get credentials.

Type:Guid
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ReturnKeyValues

Indicates whether this cmdlet returns key values.

Type:Boolean
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ServicePrincipalName

Specifies the name of the service principal from which to get credentials. An SPN must use one of the following formats:* appName

  • appName/hostname
  • a valid URLAppName represents the name of the application. Hostname represents the URI authority for the application.
Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Optional Parameters

-TenantId

Specifies the unique ID of the tenant on which to perform the operation. The default value is the tenant of the current user. This parameter applies only to partner users.

Type:Guid
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Outputs

Microsoft.Online.Administration.ServicePrincipalCredential[]