Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

New-EntraServicePrincipalKeyCredential

Creates a password credential for a service principal.

Syntax

Default (Default)

New-EntraServicePrincipalKeyCredential

 -ObjectId <String>
 [-CustomKeyIdentifier <String>]
 [-StartDate <DateTime>]
 [-EndDate <DateTime>]
 [-Type <KeyType>]
 [-Usage <KeyUsage>]
 [-Value <String>]
 [<CommonParameters>]

Description

The New-EntraServicePrincipalKeyCredential cmdlet creates a key credential for a service principal in Microsoft Entra ID.

Examples

Example 1: Create a key credential

Connect-Entra -Scopes 'Application.ReadWrite.All'
New-EntraServicePrincipalKeyCredential

This command creates a key credential for a service principal.

Parameters

-CustomKeyIdentifier

Specifies a custom key ID.

Parameter properties

Type:System.String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-EndDate

Specifies the time when the key becomes invalid as a DateTime object.

Parameter properties

Type:System.DateTime
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-ObjectId

Specifies an object ID.

Parameter properties

Type:System.String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-StartDate

Specifies the time when the key becomes valid as a DateTime object.

Parameter properties

Type:System.DateTime
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-Type

Specifies the type of the key.

Parameter properties

Type:KeyType
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-Usage

Specifies the key usage.

Parameter properties

Type:KeyUsage
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-Value

Specifies the value for the key.

Parameter properties

Type:System.String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

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.

Related Links


Feedback

Was this page helpful?