New-EntraApplicationPassword

Adds a strong password to an application.

Syntax

New-EntraApplicationPassword
   -ApplicationId <String>
   -PasswordCredential <PasswordCredential>
   [<CommonParameters>]

Description

Adds a strong password to an application.

Examples

Example 1: Add a password to an application

Connect-Entra -Scopes 'Application.ReadWrite.All','Directory.ReadWrite.All'
$application = Get-EntraApplication -Filter "DisplayName eq 'Contoso Helpdesk Application'"
$passwordCredential= New-Object Microsoft.Open.MSGraph.Model.PasswordCredential
$passwordCredential.StartDateTime = Get-Date -Year 2024 -Month 10 -Day 23
$passwordCredential.EndDateTime = Get-Date -Year 2025 -Month 2 -Day 28
$passwordCredential.CustomKeyIdentifier = [System.Text.Encoding]::UTF8.GetBytes('Analytics App Password')
$passwordCredential.Hint = 'analytics'
$passwordCredential.DisplayName = 'Analytics App Password'
New-EntraApplicationPassword -ApplicationId $application.Id -PasswordCredential $passwordCredential

CustomKeyIdentifier DisplayName EndDateTime          Hint KeyId                                SecretText                               StartDateTime
------------------- ----------- -----------          ---- -----                                ----------                               -------------
{97}                            2/28/2025 7:05:39 AM nnW  bbbbbbbb-1c1c-2d2d-3e3e-444444444444 <my-secret-text> 12/28/2024 7:05:39 AM

This example adds a password to the specified application.

  • -ApplicationId parameter specifies the unique identifier of the application.
  • -PasswordCredential parameter specifies a password credential associated with an application or a service principal.

Parameters

-ApplicationId

The unique identifier of the application object.

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

-PasswordCredential

Represents a password credential associated with an application or a service principal.

Type:PasswordCredential
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

Inputs

String

Microsoft.Open.MSGraph.Model.PasswordCredential