New-​Azure​Rm​AD​Service​Principal

Creates a new azure active directory service principal.

Syntax

New-AzureRmADServicePrincipal
   -ApplicationId <Guid>
   [-InformationAction <ActionPreference>]
   [-InformationVariable <String>]
   [-WhatIf]
   [-Confirm]
New-AzureRmADServicePrincipal
   -ApplicationId <Guid>
   [-InformationAction <ActionPreference>]
   [-InformationVariable <String>]
   [-WhatIf]
   [-Confirm]
   [-StartDate <DateTime>]
   [-EndDate <DateTime>]
   -CertValue <String>
New-AzureRmADServicePrincipal
   -ApplicationId <Guid>
   [-InformationAction <ActionPreference>]
   [-InformationVariable <String>]
   [-WhatIf]
   [-Confirm]
   -PasswordCredentials <PSADPasswordCredential[]>
New-AzureRmADServicePrincipal
   -ApplicationId <Guid>
   [-InformationAction <ActionPreference>]
   [-InformationVariable <String>]
   [-WhatIf]
   [-Confirm]
   -KeyCredentials <PSADKeyCredential[]>
New-AzureRmADServicePrincipal
   -ApplicationId <Guid>
   [-InformationAction <ActionPreference>]
   [-InformationVariable <String>]
   [-WhatIf]
   [-Confirm]
   -Password <String>
   [-StartDate <DateTime>]
   [-EndDate <DateTime>]
New-AzureRmADServicePrincipal
   [-InformationAction <ActionPreference>]
   [-InformationVariable <String>]
   [-WhatIf]
   [-Confirm]
   -Password <String>
   [-StartDate <DateTime>]
   [-EndDate <DateTime>]
   -DisplayName <String>
New-AzureRmADServicePrincipal
   [-InformationAction <ActionPreference>]
   [-InformationVariable <String>]
   [-WhatIf]
   [-Confirm]
   [-StartDate <DateTime>]
   [-EndDate <DateTime>]
   -CertValue <String>
   -DisplayName <String>
New-AzureRmADServicePrincipal
   [-InformationAction <ActionPreference>]
   [-InformationVariable <String>]
   [-WhatIf]
   [-Confirm]
   -PasswordCredentials <PSADPasswordCredential[]>
   -DisplayName <String>
New-AzureRmADServicePrincipal
   [-InformationAction <ActionPreference>]
   [-InformationVariable <String>]
   [-WhatIf]
   [-Confirm]
   -KeyCredentials <PSADKeyCredential[]>
   -DisplayName <String>
New-AzureRmADServicePrincipal
   [-InformationAction <ActionPreference>]
   [-InformationVariable <String>]
   [-WhatIf]
   [-Confirm]
   -DisplayName <String>

Description

Creates a new azure active directory service principal.

Note: The cmdlet also implicitly creates an application and sets its properties (if the ApplicationId is not provided). In order to update the application specific parameters please use Set-AzureRmADApplication cmdlet.

Examples

-------------------------- Example 1 --------------------------

@{paragraph=PS C:\>}

New-AzureRmADServicePrincipal -ApplicationId 34a28ad2-dec4-4a41-bc3b-d22ddf90000e

Creates a new azure active directory service principal.

DisplayName Type ObjectId


DemoApp ServicePrincipal f95b6f5c-fc98-4af0-bb8a-34a14ca1dca1

-------------------------- Example 2 --------------------------

@{paragraph=PS C:\>}

New-AzureRmADServicePrincipal -DisplayName SPForNoExistingApp

Creates a new service principal. The cmdlet also implicitly creates an application since one is not provided.

DisplayName Type ObjectId


SPForNoExistingApp ServicePrincipal 784136ca-3ae2-4fdd-a388-89d993e7c780

Required Parameters

-ApplicationId

The unique application id for a service principal in a tenant. Once created this property cannot be changed. If an application id is not specified, one will be generated.

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

The value of the "asymmetric" credential type. It represents the base 64 encoded certificate.

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

The friendly name of the service principal.

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

The list of certificate credentials associated with the service principal.

Type:PSADKeyCredential[]
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Password

The password to be associated with the service principal.

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

The list of password credentials associated with the service principal.

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

Optional Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-EndDate

The effective end date of the credential usage. The default end date value is one year from today. For an "asymmetric" type credential, this must be set to on or before the date that the X509 certificate is valid.

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

Specifies how this cmdlet responds to an information event.The acceptable values for this parameter are:- Continue

  • Ignore
  • Inquire
  • SilentlyContinue
  • Stop
  • Suspend
Type:ActionPreference
Aliases:infa
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-InformationVariable

Specifies an information variable.

Type:String
Aliases:iv
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-StartDate

The effective start date of the credential usage. The default start date value is today. For an "asymmetric" type credential, this must be set to on or after the date that the X509 certificate is valid from.

Type:DateTime
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-WhatIf
Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Notes

Keywords: azure, azurerm, arm, resource, management, manager, resource, group, template, deployment