New-EntraApplicationPasswordCredential

Creates a password credential for an application.

Syntax

New-EntraApplicationPasswordCredential
   -ApplicationId <String>
   [-CustomKeyIdentifier <String>]
   [-StartDate <DateTime>]
   [-EndDate <DateTime>]
   [<CommonParameters>]

Description

The New-EntraApplicationPasswordCredential cmdlet creates a password credential for an application in Microsoft Entra ID.

Examples

Example 1: Create a password credential

Connect-Entra -Scopes 'Application.ReadWrite.All','Application.ReadWrite.OwnedBy'
$application = Get-EntraApplication -Filter "displayName eq '<displayName>'"
New-EntraApplicationPasswordCredential -ApplicationId $application.Id

CustomKeyIdentifier DisplayName EndDateTime          Hint KeyId                                SecretText                    StartDateTime
------------------- ----------- -----------          ---- -----                                ----------                    -------------
                                3/21/2026 9:48:40 AM n34  tttttttt-0000-2222-0000-aaaaaaaaaaaa wbBNW8kCuiPjNRg9NX98W_aaaaaaa 3/21/2024 9:48:40 AM

This command creates new password credential for specified application.

  • -ApplicationId Specifies the ID of an application.

Example 2: Create a password credential using CustomKeyIdentifier parameter

Connect-Entra -Scopes 'Application.ReadWrite.All','Application.ReadWrite.OwnedBy'
$application = Get-EntraApplication -Filter "displayName eq '<displayName>'"
New-EntraApplicationPasswordCredential -ApplicationId $application.Id -CustomKeyIdentifier '<userfriendlyDisplayName>'

CustomKeyIdentifier DisplayName EndDateTime          Hint KeyId                                SecretText                               StartDateTime
------------------- ----------- -----------          ---- -----                                ----------                               -------------
100 101 109 111     demo        8/2/2026 11:47:53 AM 8Mw  tttttttt-0000-2222-0000-aaaaaaaaaaaa wbBNW8kCuiPjNRg9NX98W_aaaaaaa 8/2/2024 11:47:53 AM

This command creates new password credential for specified application.

  • -ApplicationId Specifies the ID of an application.
  • -CustomKeyIdentifier Speicifies unique binary identifier.

Example 3: Create a password credential using StartDate parameter

Connect-Entra -Scopes 'Application.ReadWrite.All','Application.ReadWrite.OwnedBy'
$application = Get-EntraApplication -Filter "displayName eq '<displayName>'"
$startDate = (Get-Date).AddYears(0)
New-EntraApplicationPasswordCredential -ApplicationId $application.Id -CustomKeyIdentifier '<userfriendlyDisplayName>' -StartDate $startDate

CustomKeyIdentifier DisplayName EndDateTime          Hint KeyId                                SecretText                    StartDateTime
------------------- ----------- -----------          ---- -----                                ----------                    -------------
                                3/21/2026 9:48:40 AM n34  tttttttt-0000-2222-0000-aaaaaaaaaaaa wbBNW8kCuiPjNRg9NX98W_aaaaaaa 3/21/2024 9:48:40 AM

This command creates new password credential for specified application.

  • -ApplicationId Specifies the ID of an application.
  • -StartDate Speicifies the date and time at which the password becomes valid.

Example 4: Create a password credential using EndDate parameter

Connect-Entra -Scopes 'Application.ReadWrite.All','Application.ReadWrite.OwnedBy'
$application = Get-EntraApplication -Filter "displayName eq '<displayName>'"
$endDate = (Get-Date).AddYears(2)
New-EntraApplicationPasswordCredential -ApplicationId $application.Id -CustomKeyIdentifier '<userfriendlyDisplayName>' -EndDate $endDate

CustomKeyIdentifier DisplayName EndDateTime          Hint KeyId                                SecretText                    StartDateTime
------------------- ----------- -----------          ---- -----                                ----------                    -------------
                                3/21/2026 9:48:40 AM n34  tttttttt-0000-2222-0000-aaaaaaaaaaaa wbBNW8kCuiPjNRg9NX98W_aaaaaaa 3/21/2024 9:48:40 AM

This command creates new password credential for specified application.

  • -ApplicationId Specifies the ID of an application.
  • -EndDate Speicifies The date and time at which the password expires.

Parameters

-ApplicationId

Specifies the ID of an application in Microsoft Entra ID.

Type:System.String
Aliases:ObjectId
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-CustomKeyIdentifier

A unique binary identifier.

Type:System.String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-EndDate

The date and time at which the password expires.

Type:System.DateTime
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-StartDate

The date and time at which the password becomes valid.

Type:System.DateTime
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False