New-AzureADServicePrincipal
Creates a service principal.
Syntax
Default (Default)
New-AzureADServicePrincipal
[-AccountEnabled <String>]
[-AlternativeNames <System.Collections.Generic.List`1[System.String]>]
-AppId <String>
[-AppRoleAssignmentRequired <Boolean>]
[-DisplayName <String>]
[-ErrorUrl <String>]
[-Homepage <String>]
[-KeyCredentials <System.Collections.Generic.List`1[Microsoft.Open.AzureAD.Model.KeyCredential]>]
[-LogoutUrl <String>]
[-PasswordCredentials <System.Collections.Generic.List`1[Microsoft.Open.AzureAD.Model.PasswordCredential]>]
[-PublisherName <String>]
[-ReplyUrls <System.Collections.Generic.List`1[System.String]>]
[-SamlMetadataUrl <String>]
[-ServicePrincipalNames <System.Collections.Generic.List`1[System.String]>]
[-ServicePrincipalType <String>]
[-Tags <System.Collections.Generic.List`1[System.String]>]
[<CommonParameters>]
Examples
Example 1: Create a service principal
PS C:\>New-AzureADServicePrincipal -AccountEnabled $true -AppId $MyApp.AppId -AppRoleAssignmentRequired $true -DisplayName $App -Tags {WindowsAzureActiveDirectoryIntegratedApp}
This command creates a service principal.
The tag "-Tags {WindowsAzureActiveDirectoryIntegratedApp}" is used to have this service principal show up in the list of Integrated Applications in the Admin Portal.
Parameters
-AccountEnabled
true if the service principal account is enabled; otherwise, false.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-AlternativeNames
The alternative names for this service principal
Parameter properties
Type: List<T> [ String ]
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-AppId
The unique identifier for the associated application (its appId property).
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-AppRoleAssignmentRequired
Indicates whether an application role assignment is required.
Parameter properties
Type: Boolean
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-DisplayName
Specifies the display name.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ErrorUrl
Specifies the error URL.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Homepage
Specifies the home page.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-KeyCredentials
The collection of key credentials associated with the service principal.
Parameter properties
Type: List<T> [ Microsoft.Open.AzureAD.Model.KeyCredential ]
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-LogoutUrl
Specifies the logout URL.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-PasswordCredentials
Specifies password credentials.
Parameter properties
Type: List<T> [ Microsoft.Open.AzureAD.Model.PasswordCredential ]
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-PublisherName
Specifies the publisher name.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ReplyUrls
The URLs that user tokens are sent to for sign in with the associated application, or the redirect URIs that OAuth 2.0 authorization codes and access tokens are sent to for the associated application.
Parameter properties
Type: List<T> [ String ]
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
The URL for the SAML metadata
Type: String
Default value: None
Supports wildcards: False
DontShow: False
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ServicePrincipalNames
Specifies an array of service principal names.
Based on the identifierURIs collection, plus the application's appId property, these URIs are used to reference an application's service principal.
A client will use these to:
populate requiredResourceAccess, via "Permissions to other applications" in the Azure classic portal. - specify a resource URI to acquire an access token, which is the URI returned in the claim.
Parameter properties
Type: List<T> [ String ]
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ServicePrincipalType
THe type of the service principal
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
Tags linked to this service principal.
Note that if you intend for this service principal to show up in the All Applications list in the admin portal, you need to set this value to {WindowsAzureActiveDirectoryIntegratedApp}
Type: List<T> [ String ]
Default value: None
Supports wildcards: False
DontShow: False
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
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 .
Notes