Get-AzureRmADServicePrincipal

篩選 Active Directory 服務主體。

警告

自 2024 年 2 月 29 日起,AzureRM PowerShell 模組已正式淘汰。 建議使用者從 AzureRM 遷移至 Az PowerShell 模組,以確保持續支援和更新。

雖然 AzureRM 模組可能仍可運作,但不再維護或支援它,但會根據用戶的判斷權和風險放置任何繼續使用。 如需轉換至 Az 模組的指引,請參閱我們的 移轉資源

語法

Get-AzureRmADServicePrincipal
   [-DefaultProfile <IAzureContextContainer>]
   [-IncludeTotalCount]
   [-Skip <UInt64>]
   [-First <UInt64>]
   [<CommonParameters>]
Get-AzureRmADServicePrincipal
   -DisplayNameBeginsWith <String>
   [-DefaultProfile <IAzureContextContainer>]
   [-IncludeTotalCount]
   [-Skip <UInt64>]
   [-First <UInt64>]
   [<CommonParameters>]
Get-AzureRmADServicePrincipal
   -DisplayName <String>
   [-DefaultProfile <IAzureContextContainer>]
   [-IncludeTotalCount]
   [-Skip <UInt64>]
   [-First <UInt64>]
   [<CommonParameters>]
Get-AzureRmADServicePrincipal
   -ObjectId <Guid>
   [-DefaultProfile <IAzureContextContainer>]
   [-IncludeTotalCount]
   [-Skip <UInt64>]
   [-First <UInt64>]
   [<CommonParameters>]
Get-AzureRmADServicePrincipal
   -ApplicationId <Guid>
   [-DefaultProfile <IAzureContextContainer>]
   [-IncludeTotalCount]
   [-Skip <UInt64>]
   [-First <UInt64>]
   [<CommonParameters>]
Get-AzureRmADServicePrincipal
   -ApplicationObject <PSADApplication>
   [-DefaultProfile <IAzureContextContainer>]
   [-IncludeTotalCount]
   [-Skip <UInt64>]
   [-First <UInt64>]
   [<CommonParameters>]
Get-AzureRmADServicePrincipal
   -ServicePrincipalName <String>
   [-DefaultProfile <IAzureContextContainer>]
   [-IncludeTotalCount]
   [-Skip <UInt64>]
   [-First <UInt64>]
   [<CommonParameters>]

Description

篩選 Active Directory 服務主體。

範例

範例 1 - 列出 AD 服務主體

PS C:\> Get-AzureRmADServicePrincipal

列出租使用者中的所有AD服務主體。

範例 2 - 使用分頁列出 AD 服務主體

PS C:\> Get-AzureRmADServicePrincipal -First 100

列出租使用者中的前 100 個 AD 服務主體。

範例 3 - 依 SPN 列出服務主體

PS C:\> Get-AzureRmADServicePrincipal -ServicePrincipalName 36f81fc3-b00f-48cd-8218-3879f51ff39f

列出 SPN '36f81fc3-b00f-48cd-8218-3879f51ff39f' 的服務主體。

範例 4 - 依搜尋字串列出服務主體

PS C:\> Get-AzureRmADServicePrincipal -SearchString "Web"

列出顯示名稱開頭為 「Web」 的所有 AD 服務主體。

範例 5 - 透過管線列出服務主體

PS C:\> Get-AzureRmADApplication -ObjectId 39e64ec6-569b-4030-8e1c-c3c519a05d69 | Get-AzureRmADServicePrincipal

取得物件標識符為 『39e64ec6-569b-4030-8e1c-c3c519a05d69』 的 AD 應用程式,並將它傳送至 Get-AzureRmADServicePrincipal Cmdlet 以列出該應用程式的所有服務主體。

參數

-ApplicationId

服務主體應用程式識別碼。

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

-ApplicationObject

正在擷取其服務主體的應用程式物件。

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

-DefaultProfile

用於與 azure 通訊的認證、帳戶、租用戶和訂用帳戶

類型:IAzureContextContainer
別名:AzureRmContext, AzureCredential
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-DisplayName

服務主體顯示名稱。

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

-DisplayNameBeginsWith

服務主體搜尋字串。

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

-First

要傳回的物件數目上限。

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

-IncludeTotalCount

報告數據集中的物件數目。 目前,此參數不會執行任何動作。

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

-ObjectId

服務主體的物件標識碼。

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

-ServicePrincipalName

服務的SPN。

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

-Skip

忽略第一個 N 物件,然後取得其餘的物件。

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

輸入

String

Guid

PSADApplication

參數:ApplicationObject (ByValue)

輸出

PSADServicePrincipal