Freigeben über


New-AzADAppCredential

Erstellt Schlüsselanmeldeinformationen oder Kennwortanmeldeinformationen für eine Anwendung.

Syntax

New-AzADAppCredential
   -ObjectId <String>
   [-StartDate <DateTime>]
   [-EndDate <DateTime>]
   [-CustomKeyIdentifier <String>]
   [-DefaultProfile <PSObject>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzADAppCredential
   -ObjectId <String>
   [-StartDate <DateTime>]
   [-EndDate <DateTime>]
   [-CustomKeyIdentifier <String>]
   -CertValue <String>
   [-DefaultProfile <PSObject>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzADAppCredential
   -ObjectId <String>
   [-CustomKeyIdentifier <String>]
   -KeyCredentials <MicrosoftGraphKeyCredential[]>
   [-DefaultProfile <PSObject>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzADAppCredential
   -ObjectId <String>
   [-CustomKeyIdentifier <String>]
   -PasswordCredentials <MicrosoftGraphPasswordCredential[]>
   [-DefaultProfile <PSObject>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzADAppCredential
   [-StartDate <DateTime>]
   [-EndDate <DateTime>]
   [-CustomKeyIdentifier <String>]
   -ApplicationObject <IMicrosoftGraphApplication>
   [-DefaultProfile <PSObject>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzADAppCredential
   [-StartDate <DateTime>]
   [-EndDate <DateTime>]
   [-CustomKeyIdentifier <String>]
   -CertValue <String>
   -ApplicationObject <IMicrosoftGraphApplication>
   [-DefaultProfile <PSObject>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzADAppCredential
   [-StartDate <DateTime>]
   [-EndDate <DateTime>]
   [-CustomKeyIdentifier <String>]
   -DisplayName <String>
   [-DefaultProfile <PSObject>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzADAppCredential
   [-StartDate <DateTime>]
   [-EndDate <DateTime>]
   [-CustomKeyIdentifier <String>]
   -CertValue <String>
   -DisplayName <String>
   [-DefaultProfile <PSObject>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzADAppCredential
   [-StartDate <DateTime>]
   [-EndDate <DateTime>]
   [-CustomKeyIdentifier <String>]
   -CertValue <String>
   -ApplicationId <Guid>
   [-DefaultProfile <PSObject>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzADAppCredential
   [-StartDate <DateTime>]
   [-EndDate <DateTime>]
   [-CustomKeyIdentifier <String>]
   -ApplicationId <Guid>
   [-DefaultProfile <PSObject>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzADAppCredential
   [-CustomKeyIdentifier <String>]
   -PasswordCredentials <MicrosoftGraphPasswordCredential[]>
   -ApplicationObject <IMicrosoftGraphApplication>
   [-DefaultProfile <PSObject>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzADAppCredential
   [-CustomKeyIdentifier <String>]
   -PasswordCredentials <MicrosoftGraphPasswordCredential[]>
   -DisplayName <String>
   [-DefaultProfile <PSObject>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzADAppCredential
   [-CustomKeyIdentifier <String>]
   -PasswordCredentials <MicrosoftGraphPasswordCredential[]>
   -ApplicationId <Guid>
   [-DefaultProfile <PSObject>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzADAppCredential
   [-CustomKeyIdentifier <String>]
   -KeyCredentials <MicrosoftGraphKeyCredential[]>
   -ApplicationObject <IMicrosoftGraphApplication>
   [-DefaultProfile <PSObject>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzADAppCredential
   [-CustomKeyIdentifier <String>]
   -KeyCredentials <MicrosoftGraphKeyCredential[]>
   -DisplayName <String>
   [-DefaultProfile <PSObject>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzADAppCredential
   [-CustomKeyIdentifier <String>]
   -KeyCredentials <MicrosoftGraphKeyCredential[]>
   -ApplicationId <Guid>
   [-DefaultProfile <PSObject>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Beschreibung

Erstellt Schlüsselanmeldeinformationen oder Kennwortanmeldeinformationen für eine Anwendung.

Beispiele

Beispiel 1: Erstellen von Schlüsselanmeldeinformationen für die Anwendung

# ObjectId is the string representation of a GUID for directory object, application, in Azure AD.
$Id = "00000000-0000-0000-0000-000000000000"
# $cert is Base64 encoded content of certificate
$credential = New-Object -TypeName "Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphKeyCredential" `
                                 -Property @{'Key' = $cert;
                                 'Usage'       = 'Verify';
                                 'Type'        = 'AsymmetricX509Cert'
                                 }
New-AzADAppCredential -ObjectId $Id -KeyCredentials $credential

Erstellen von Schlüsselanmeldeinformationen für die Anwendung mit Objekt-ID $Id

Beispiel 2: Erstellen von Kennwortanmeldeinformationen für die Anwendung

# ApplicationId is AppId of Application object which is different from directory id in Azure AD.
Get-AzADApplication -ApplicationId $appId | New-AzADAppCredential -StartDate $startDate -EndDate $endDate

Erstellen von Kennwortanmeldeinformationen für die Anwendung

Parameter

-ApplicationId

Die Anwendungs-ID.

Typ:Guid
Position:Named
Standardwert:None
Erforderlich:True
Pipelineeingabe akzeptieren:False
Platzhalterzeichen akzeptieren:False

-ApplicationObject

Das Anwendungsobjekt kann als Pipelineeingabe verwendet werden.

Typ:IMicrosoftGraphApplication
Position:Named
Standardwert:None
Erforderlich:True
Pipelineeingabe akzeptieren:True
Platzhalterzeichen akzeptieren:False

-CertValue

Der Wert des Asymmetrischen Anmeldeinformationstyps. Sie stellt das base64-codierte Zertifikat dar.

Typ:String
Position:Named
Standardwert:None
Erforderlich:True
Pipelineeingabe akzeptieren:False
Platzhalterzeichen akzeptieren:False

-Confirm

Fordert Sie vor dem Ausführen des Cmdlets zur Bestätigung auf.

Typ:SwitchParameter
Aliase:cf
Position:Named
Standardwert:None
Erforderlich:False
Pipelineeingabe akzeptieren:False
Platzhalterzeichen akzeptieren:False

-CustomKeyIdentifier

Benutzerdefinierter Schlüsselbezeichner. Das Format sollte base64 sein: $Bytes=[System.Text.Encoding]::Unicode.GetBytes($key);$key=[Convert]::ToBase64String($Bytes)

Typ:String
Position:Named
Standardwert:None
Erforderlich:False
Pipelineeingabe akzeptieren:False
Platzhalterzeichen akzeptieren:False

-DefaultProfile

Die Anmeldeinformationen, Konten, Mandanten und Abonnements, die für die Kommunikation mit Azure verwendet werden.

Typ:PSObject
Aliase:AzContext, AzureRmContext, AzureCredential
Position:Named
Standardwert:None
Erforderlich:False
Pipelineeingabe akzeptieren:False
Platzhalterzeichen akzeptieren:False

-DisplayName

Der Anzeigename der Anwendung.

Typ:String
Position:Named
Standardwert:None
Erforderlich:True
Pipelineeingabe akzeptieren:False
Platzhalterzeichen akzeptieren:False

-EndDate

Das effektive Enddatum der Anmeldeinformationsnutzung. Der Standard-Enddatumswert ist ein Jahr von heute. Für Anmeldeinformationen vom Typ "asymmetrisch" muss dies auf das Datum festgelegt werden, an dem das X509-Zertifikat gültig ist.

Typ:DateTime
Position:Named
Standardwert:None
Erforderlich:False
Pipelineeingabe akzeptieren:False
Platzhalterzeichen akzeptieren:False

-KeyCredentials

Schlüsselanmeldeinformationen, die der Anwendung zugeordnet sind.

Typ:MicrosoftGraphKeyCredential[]
Position:Named
Standardwert:None
Erforderlich:True
Pipelineeingabe akzeptieren:False
Platzhalterzeichen akzeptieren:False

-ObjectId

Die Objekt-ID der Anwendung.

Typ:String
Aliase:Id
Position:Named
Standardwert:None
Erforderlich:True
Pipelineeingabe akzeptieren:False
Platzhalterzeichen akzeptieren:False

-PasswordCredentials

Kennwortanmeldeinformationen, die der Anwendung zugeordnet sind.

Typ:MicrosoftGraphPasswordCredential[]
Position:Named
Standardwert:None
Erforderlich:True
Pipelineeingabe akzeptieren:False
Platzhalterzeichen akzeptieren:False

-StartDate

Das effektive Startdatum der Anmeldeinformationenverwendung. Der Standardanfangsdatumswert ist heute. Bei Anmeldeinformationen vom Typ "asymmetrisch" muss dies auf ein oder nach dem Datum festgelegt werden, von dem das X509-Zertifikat gültig ist.

Typ:DateTime
Position:Named
Standardwert:None
Erforderlich:False
Pipelineeingabe akzeptieren:False
Platzhalterzeichen akzeptieren:False

-WhatIf

Zeigt, was passiert, wenn das Cmdlet ausgeführt wird. Das Cmdlet wird nicht ausgeführt.

Typ:SwitchParameter
Aliase:wi
Position:Named
Standardwert:None
Erforderlich:False
Pipelineeingabe akzeptieren:False
Platzhalterzeichen akzeptieren:False

Eingaben

IMicrosoftGraphApplication

Ausgaben

IMicrosoftGraphKeyCredential

IMicrosoftGraphPasswordCredential