New-EntraApplicationPassword

アプリケーションに強力なパスワードを追加します。

構文

Default (既定)

New-EntraApplicationPassword

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

説明

アプリケーションに強力なパスワードを追加します。

例 1: アプリケーションにパスワードを追加する

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

次の使用例は、指定したアプリケーションにパスワードを追加します。

  • -ApplicationId パラメーターは、アプリケーションの一意識別子を指定します。
  • -PasswordCredential パラメーターは、アプリケーションまたはサービス プリンシパルに関連付けられているパスワード資格情報を指定します。

パラメーター

-ApplicationId

アプリケーション オブジェクトの一意識別子。

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

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

パラメーター セット

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

-PasswordCredential

アプリケーションまたはサービス プリンシパルに関連付けられているパスワード資格情報を表します。

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

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

パラメーター セット

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

CommonParameters

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

入力

String

Microsoft.Open.MSGraph.Model.PasswordCredential