Get-AzureRmADSpCredential
擷取與服務主體相關聯的認證清單。
警告
自 2024 年 2 月 29 日起,AzureRM PowerShell 模組已正式淘汰。 建議使用者從 AzureRM 遷移至 Az PowerShell 模組,以確保持續支援和更新。
雖然 AzureRM 模組可能仍可運作,但不再維護或支援它,但會根據用戶的判斷權和風險放置任何繼續使用。 如需轉換至 Az 模組的指引,請參閱我們的 移轉資源 。
語法
Get-AzureRmADSpCredential
-ObjectId <Guid>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzureRmADSpCredential
-ServicePrincipalName <String>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzureRmADSpCredential
-DisplayName <String>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzureRmADSpCredential
-ServicePrincipalObject <PSADServicePrincipal>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
Get-AzureRmADSpCredential Cmdlet 可用來擷取與服務主體相關聯的認證清單。 此命令會擷取與服務主體相關聯的所有認證屬性(但不擷取認證值)。
範例
範例 1 - 依 SPN 列出認證
PS C:\> Get-AzureRmADSpCredential -ServicePrincipalName http://test12345
傳回與 SPN'http://test12345' 服務主體相關聯的認證清單。
範例 2 - 依物件標識碼列出認證
PS C:\> Get-AzureRmADSpCredential -ObjectId 58e28616-99cc-4da4-b705-7672130e1047
傳回與服務主體相關聯的認證清單,其對象標識碼為 “58e28616-99cc-4da4-b705-7672130e1047”。
範例 3 - 依管線列出認證
PS C:\> Get-AzureRmADServicePrincipal -ObjectId 58e28616-99cc-4da4-b705-7672130e1047 | Get-AzureRmADSpCredential
取得對象標識碼為 “58e28616-99cc-4da4-b705-7672130e1047” 的服務主體,並將其傳送至 Get-AzureRmADSpCredential Cmdlet,以列出該服務主體的所有認證。
參數
-DefaultProfile
用於與 azure 通訊的認證、帳戶、租用戶和訂用帳戶
類型: | IAzureContextContainer |
別名: | AzureRmContext, AzureCredential |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-DisplayName
服務主體的顯示名稱
類型: | String |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |
-ObjectId
要從中擷取認證的服務主體對象標識碼。
類型: | Guid |
別名: | Id |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |
-ServicePrincipalName
要從中擷取認證之服務主體的名稱 (SPN)。
類型: | String |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |
-ServicePrincipalObject
要從中擷取認證的服務主體物件。
類型: | PSADServicePrincipal |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |
輸入
參數:ServicePrincipalObject (ByValue)