New-AzureADServicePrincipal

建立服務主體。

語法

New-AzureADServicePrincipal
   [-AccountEnabled <String>]
   [-AlternativeNames <System.Collections.Generic.List`1[System.String]>]
   -AppId <String>
   [-AppRoleAssignmentRequired <Boolean>]
   [-DisplayName <String>]
   [-ErrorUrl <String>]
   [-Homepage <String>]
   [-KeyCredentials <System.Collections.Generic.List`1[Microsoft.Open.AzureAD.Model.KeyCredential]>]
   [-LogoutUrl <String>]
   [-PasswordCredentials <System.Collections.Generic.List`1[Microsoft.Open.AzureAD.Model.PasswordCredential]>]
   [-PublisherName <String>]
   [-ReplyUrls <System.Collections.Generic.List`1[System.String]>]
   [-SamlMetadataUrl <String>]
   [-ServicePrincipalNames <System.Collections.Generic.List`1[System.String]>]
   [-ServicePrincipalType <String>]
   [-Tags <System.Collections.Generic.List`1[System.String]>]
   [<CommonParameters>]

範例

範例 1:建立服務主體

PS C:\>New-AzureADServicePrincipal -AccountEnabled $true -AppId $MyApp.AppId -AppRoleAssignmentRequired $true -DisplayName $App -Tags {WindowsAzureActiveDirectoryIntegratedApp}

此命令會建立服務主體。 “-Tags {WindowsAzureActiveDirectoryIntegratedApp}” 標記可用來讓此服務主體顯示在管理入口網站中的整合式應用程式清單中。

參數

-AccountEnabled

若已啟用服務主體帳戶,則為 true;否則為 false。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-AlternativeNames

此服務主體的替代名稱

類型:List<T>[String]
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-AppId

相關聯應用程式的唯一識別碼 (其 appId 屬性)。

類型:String
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-AppRoleAssignmentRequired

指出是否需要應用程式角色指派。

類型:Boolean
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-DisplayName

指定顯示名稱。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-ErrorUrl

指定錯誤 URL。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-Homepage

指定首頁。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-KeyCredentials

與服務主體相關聯的金鑰認證集合。

類型:List<T>[Microsoft.Open.AzureAD.Model.KeyCredential]
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-LogoutUrl

指定註銷 URL。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-PasswordCredentials

指定密碼認證。

類型:List<T>[Microsoft.Open.AzureAD.Model.PasswordCredential]
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-PublisherName

指定發行者名稱。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-ReplyUrls

為了供相關聯的應用程式登入而將使用者權杖傳送到的 URL,或為了存取相關聯的應用程式而將 OAuth 2.0 授權碼和存取權杖傳送到的重新導向 URL。

類型:List<T>[String]
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-SamlMetadataUrl

SAML 元數據的 URL

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-ServicePrincipalNames

指定服務主體名稱的陣列。 根據 identifierURIs 集合,加上應用程式的 appId 屬性,這些 URI 會用來參考應用程式的服務主體。 用戶端會使用這些來:

  • 透過 Azure 傳統入口網站中的「其他應用程式的許可權」填入 requiredResourceAccess。 - 指定資源 URI 以取得存取令牌,這是宣告中傳回的 URI。
類型:List<T>[String]
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-ServicePrincipalType

服務主體的類型

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-Tags

連結至此服務主體的標記。

請注意,如果您想要讓此服務主體顯示在管理入口網站的 [所有應用程式] 列表中,您必須將此值設定為 {WindowsAzureActiveDirectoryIntegratedApp}

類型:List<T>[String]
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

備註

請參閱 New-AzureADServicePrincipal 至 Microsoft Graph PowerShell 的移轉指南。