当前位置:网站首页 > 更多 > 玩电脑 > 正文

[玩转系统] 删除 MsolServicePrincipalCredential

作者:精品下载站 日期:2024-12-14 06:27:12 浏览:12 分类:玩电脑

删除 MsolServicePrincipalCredential


PowerShell 中的 Remove-MsolServicePrincipalCredential cmdlet 可从 Microsoft Office 365 中的服务主体中删除凭据密钥。

下面给出了从服务主体删除凭证密钥的语法。

Remove-MsolServicePrincipalCredential
      -ObjectId <Guid>
      -KeyIds <Guid[]>
      -ServicePrincipalName <String>
      -AppPrincipalId <Guid>
      [-TenantId <Guid>]
      [<CommonParameters>]

在本文中,我们将讨论如何使用 PowerShell 中的 Remove-MsolServicePrincipalCredential cmdlet 从 Azure Active Directory 中的服务主体中删除凭据。

如何从服务主体中删除凭证

若要从 Office 365 中的服务主体中删除凭据,请使用带有 -KeyIds-ServicePricipalName 参数的Remove-MsolServicePrincipalCredential。

-KeyIds 参数指定要删除的凭据密钥的唯一 ID 数组。您可以使用 Get-MsolServicePrincipalCredential cmdlet 获取服务主体的密钥 ID。

-ServicePrincipalName 参数指定要从中删除凭据的服务主体的名称。 SPN 必须使用以下格式之一:

  • 应用程序名称
  • 应用程序名称/主机名
  • 有效的网址
# Remove the credentials for a service principal
Remove-MsolServicePrincipalCredential -KeyIds @("8a569c80-a495-40b0-bc2a-b72e38e1688e") -ServicePrincipalName "ShellGeek/ShellApp.com"

此命令从服务主体中删除凭证密钥。在上面的示例中,使用 Get-MsolServicePrincipalCredential cmdlet“8a569c80-a495-40b0-bc2a-b72e38e1688e ”检索的密钥 ID 已从与服务关联的服务主体中删除主体名称“ShellGeek/ShellApp.com”。

结论

我希望上述有关如何使用 PowerShell 中的 Remove-MsolServicePrincipalCredential cmdlet 从服务主体中删除凭据的文章对您有所帮助。

您可以在 ShellGeek 主页上找到有关 PowerShell Active Directory 命令和 PowerShell 基础知识的更多主题。

相关链接

新-MsolServicePrincipalCredential

获取 MsolServicePrincipalCredential

您需要 登录账户 后才能发表评论

取消回复欢迎 发表评论:

关灯