New-EntraApplicationPassword

Ajoute un mot de passe fort à une application.

Syntaxe

Default (Par défaut)

New-EntraApplicationPassword

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

Description

Ajoute un mot de passe fort à une application.

Exemples

Exemple 1 : Ajouter un mot de passe à une 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

Cet exemple ajoute un mot de passe à l’application spécifiée.

  • -ApplicationId spécifie l’identificateur unique de l’application.
  • -PasswordCredential spécifie des informations d’identification de mot de passe associées à une application ou à un principal de service.

Paramètres

-ApplicationId

Identificateur unique de l’objet d’application.

Propriétés du paramètre

Type:System.String
Valeur par défaut:None
Prend en charge les caractères génériques:False
DontShow:False
Alias:Identifiant d'objet (ObjectId)

Jeux de paramètres

(All)
Position:Named
Obligatoire:True
Valeur du pipeline:True
Valeur du pipeline par nom de propriété:True
Valeur des arguments restants:False

-PasswordCredential

Représente des informations d’identification de mot de passe associées à une application ou à un principal de service.

Propriétés du paramètre

Type:PasswordCredential
Valeur par défaut:None
Prend en charge les caractères génériques:False
DontShow:False

Jeux de paramètres

(All)
Position:Named
Obligatoire:True
Valeur du pipeline:False
Valeur du pipeline par nom de propriété:False
Valeur des arguments restants:False

CommonParameters

Cette applet de commande prend en charge les paramètres courants : -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction et -WarningVariable. Pour plus d’informations, consultez about_CommonParameters.

Entrées

String

Microsoft.Open.MSGraph.Model.PasswordCredential