你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Remove-AzureADOAuth2PermissionGrant
删除 oAuth2PermissionGrant。
语法
Remove-AzureADOAuth2PermissionGrant
-ObjectId <String>
[-InformationAction <ActionPreference>]
[-InformationVariable <String>]
[<CommonParameters>]
说明
Remove-AzureADOAuth2PermissionGrant cmdlet 删除 Azure Active Directory (AD) 中的 oAuth2PermissionGrant 对象。
示例
示例 1:删除 OAuth2 权限授予
PS C:\> $SharePointSP = Get-AzureADServicePrincipal | Where-Object {$_.DisplayName -eq "Microsoft.SharePoint"}
PS C:\> $SharePointOA2AllSitesRead = Get-AzureADOAuth2PermissionGrant | Where-Object {$_.ResourceId -eq $SharePointSP.ObjectId} | Where-Object {$_.Scope -eq "AllSites.Read"}
PS C:\> Remove-AzureADOAuth2PermissionGrant -ObjectId $SharePointOA2AllSitesRead.ObjectId
第一个命令使用 Get-AzureADServicePrincipal (./Get-AzureADServicePrincipal.md) cmdlet 获取与指定显示名称匹配的服务主体。 该命令将结果存储在$SharePointSP变量中。
第二个命令使用 Get-AzureADOAuth2PermissionGrant (./Get-AzureADOAuth2PermissionGrant.md) cmdlet 获取某些权限授予。 该命令将结果存储在 $SharePointOA 2AllSitesRead 变量中。
最终命令在 $SharePointOA 2AllSitesRead 中删除权限授予。
参数
-InformationAction
指定此 cmdlet 如何响应信息事件。 此参数的可接受值为:
- 继续
- 忽略
- 查询
- SilentlyContinue
- 停止
- 挂起
Type: | ActionPreference |
Aliases: | infa |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-InformationVariable
指定信息变量。
Type: | String |
Aliases: | iv |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ObjectId
指定 Azure AD 中 oAuth2PermissionGrant 对象的 ID。
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈