New-EntraApplicationPasswordCredential

アプリケーションのパスワード資格情報を作成します。

構文

Default (既定)

New-EntraApplicationPasswordCredential

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

説明

New-EntraApplicationPasswordCredential コマンドレットは、Microsoft Entra IDでアプリケーションのパスワード資格情報を作成します。

例 1: パスワード資格情報を作成する

Connect-Entra -Scopes 'Application.ReadWrite.All','Application.ReadWrite.OwnedBy'
$application = Get-EntraApplication -Filter "displayName eq '<displayName>'"
$secret = New-EntraApplicationPasswordCredential -ApplicationId $application.Id
$secret | Format-List
CustomKeyIdentifier  : 77 97 114 97 32 76 117 120 117 114 121...
Value                : wbBNW8kCuiPjNRg9NX98W_aaaaaaa
DisplayName          : Contoso Automation account
EndDateTime          : 5/9/2027 11:53:40 AM
Hint                 : WBB
KeyId                : tttttttt-0000-2222-0000-aaaaaaaaaaaa
SecretText           : wbBNW8kCuiPjNRg9NX98W_aaaaaaa
StartDateTime        : 5/9/2025 11:53:39 AM

このコマンドは、指定されたアプリケーションの新しいパスワード資格情報を作成します。

  • -ApplicationId アプリケーションの ID を指定します。

例 2: CustomKeyIdentifier パラメーターを使用してパスワード資格情報を作成する

Connect-Entra -Scopes 'Application.ReadWrite.All','Application.ReadWrite.OwnedBy'
$application = Get-EntraApplication -Filter "displayName eq '<displayName>'"
$secret = New-EntraApplicationPasswordCredential -ApplicationId $application.Id -CustomKeyIdentifier '<userfriendlyDisplayName>'
$secret | Format-List
CustomKeyIdentifier  : 77 97 114 97 32 76 117 120 117 114 121...
Value                : wbBNW8kCuiPjNRg9NX98W_aaaaaaa
DisplayName          : Contoso Automation account
EndDateTime          : 5/9/2027 11:53:40 AM
Hint                 : WBB
KeyId                : tttttttt-0000-2222-0000-aaaaaaaaaaaa
SecretText           : wbBNW8kCuiPjNRg9NX98W_aaaaaaa
StartDateTime        : 5/9/2025 11:53:39 AM

このコマンドは、指定されたアプリケーションの新しいパスワード資格情報を作成します。

  • -ApplicationId アプリケーションの ID を指定します。
  • -CustomKeyIdentifier 一意のバイナリ識別子を指定します。

例 3: StartDate パラメーターを使用してパスワード資格情報を作成する

Connect-Entra -Scopes 'Application.ReadWrite.All','Application.ReadWrite.OwnedBy'
$application = Get-EntraApplication -Filter "displayName eq '<displayName>'"
$startDate = (Get-Date).AddYears(0)
$secret = New-EntraApplicationPasswordCredential -ApplicationId $application.Id -CustomKeyIdentifier '<userfriendlyDisplayName>' -StartDate $startDate
$secret | Format-List
CustomKeyIdentifier  : 77 97 114 97 32 76 117 120 117 114 121...
Value                : wbBNW8kCuiPjNRg9NX98W_aaaaaaa
DisplayName          : Contoso Automation account
EndDateTime          : 5/9/2027 11:53:40 AM
Hint                 : WBB
KeyId                : tttttttt-0000-2222-0000-aaaaaaaaaaaa
SecretText           : wbBNW8kCuiPjNRg9NX98W_aaaaaaa
StartDateTime        : 5/9/2025 11:53:39 AM

このコマンドは、指定されたアプリケーションの新しいパスワード資格情報を作成します。

  • -ApplicationId アプリケーションの ID を指定します。
  • -StartDate パスワードが有効になる日時を指定します。

例 4: EndDate パラメーターを使用してパスワード資格情報を作成する

Connect-Entra -Scopes 'Application.ReadWrite.All','Application.ReadWrite.OwnedBy'
$application = Get-EntraApplication -Filter "displayName eq '<displayName>'"
$endDate = (Get-Date).AddYears(2)
$secret = New-EntraApplicationPasswordCredential -ApplicationId $application.Id -CustomKeyIdentifier '<userfriendlyDisplayName>' -EndDate $endDate
$secret | Format-List
CustomKeyIdentifier  : 77 97 114 97 32 76 117 120 117 114 121...
Value                : wbBNW8kCuiPjNRg9NX98W_aaaaaaa
DisplayName          : Contoso Automation account
EndDateTime          : 5/9/2027 11:53:40 AM
Hint                 : WBB
KeyId                : tttttttt-0000-2222-0000-aaaaaaaaaaaa
SecretText           : wbBNW8kCuiPjNRg9NX98W_aaaaaaa
StartDateTime        : 5/9/2025 11:53:39 AM

このコマンドは、指定されたアプリケーションの新しいパスワード資格情報を作成します。

  • -ApplicationId アプリケーションの ID を指定します。
  • -EndDate パスワードの有効期限が切れる日時を指定します。

パラメーター

-ApplicationId

Microsoft Entra IDのアプリケーションの ID を指定します。

パラメーターのプロパティ

型:System.String
規定値:None
ワイルドカードのサポート:False
DontShow:False
Aliases:オブジェクト識別子

パラメーター セット

(All)
配置:Named
必須:True
パイプラインからの値:True
プロパティ名別のパイプラインからの値:True
残りの引数からの値:False

-CustomKeyIdentifier

一意のバイナリ識別子。

パラメーターのプロパティ

型:System.String
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:True
パイプラインからの値:True
プロパティ名別のパイプラインからの値:True
残りの引数からの値:False

-EndDate

パスワードの有効期限が切れる日時。

パラメーターのプロパティ

型:System.DateTime
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:True
プロパティ名別のパイプラインからの値:True
残りの引数からの値:False

-StartDate

パスワードが有効になる日時。

パラメーターのプロパティ

型:System.DateTime
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:True
プロパティ名別のパイプラインからの値:True
残りの引数からの値:False

CommonParameters

このコマンドレットでは、一般的なパラメーター -Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction、-WarningVariable の各パラメーターがサポートされています。 詳細については、about_CommonParametersを参照してください。