共用方式為


Remove-RdsRoleAssignment

刪除角色分配。

語法

EmptyParameterSet (預設值)

Remove-RdsRoleAssignment
    [<CommonParameters>]

SignInNameRoleAssignmentDeploymentScopeParameterSet

Remove-RdsRoleAssignment
    [-TenantGroupName <String>]
    [-TenantName <String>]
    [-HostPoolName <String>]
    [-AppGroupName <String>]
    [<CommonParameters>]

SignInNameRoleAssignmentTenantGroupScopeParameterSet

Remove-RdsRoleAssignment
    [-RoleDefinitionName] <string>
    -SignInName <string>
    -TenantName <string>
    [-AADTenantId <string>]
    [-TenantGroupName <string>]
    [<CommonParameters>]

SignInNameRoleAssignmentHostPoolScopeParameterSet

Remove-RdsRoleAssignment
    [-RoleDefinitionName] <string>
    -SignInName <string>
    -TenantName <string>
    -HostPoolName <string>
    [-AADTenantId <string>]
    [-TenantGroupName <string>]
    [<CommonParameters>]

SignInNameRoleAssignmentAppGroupScopeParameterSet

Remove-RdsRoleAssignment
    [-RoleDefinitionName] <string>
    -SignInName <string>
    -TenantName <string>
    -HostPoolName <string>
    -AppGroupName <string>
    [-AADTenantId <string>]
    [-TenantGroupName <string>]
    [<CommonParameters>]

SPNRoleAssignmentDeploymentScopeParameterSet

Remove-RdsRoleAssignment
    [-RoleDefinitionName] <string>
    -ApplicationId <string>
    -Deployment
    [<CommonParameters>]

SPNRoleAssignmentTenantGroupScopeParameterSet

Remove-RdsRoleAssignment
    [-RoleDefinitionName] <string>
    -ApplicationId <string>
    -TenantGroupName <string>
    [<CommonParameters>]

SPNRoleAssignmentTenantScopeParameterSet

Remove-RdsRoleAssignment
    [-RoleDefinitionName] <string>
    -ApplicationId <string>
    -TenantName <string>
    [-TenantGroupName <string>]
    [<CommonParameters>]

SPNRoleAssignmentHostPoolScopeParameterSet

Remove-RdsRoleAssignment
    [-RoleDefinitionName] <string>
    -ApplicationId <string>
    -TenantName <string>
    -HostPoolName <string>
    [-TenantGroupName <string>]
    [<CommonParameters>]

ServicePrincipalParameterSet

Remove-RdsRoleAssignment
    [-RoleDefinitionName] <String>
    -ApplicationId <String>
    [-TenantGroupName <String>]
    [-TenantName <String>]
    [-HostPoolName <String>]
    [-AppGroupName <String>]
    [<CommonParameters>]

SPNRoleAssignmentAppGroupScopeParameterSet

Remove-RdsRoleAssignment
    [-RoleDefinitionName] <string>
    -ApplicationId <string>
    -TenantName <string>
    -HostPoolName <string>
    -AppGroupName <string>
    [-TenantGroupName <string>]
    [<CommonParameters>]

GroupRoleAssignmentDeploymentScopeParameterSet

Remove-RdsRoleAssignment
    -RoleDefinitionName <string>
    -GroupObjectId <string>
    -AADTenantId <string>
    -Deployment
    [<CommonParameters>]

GroupRoleAssignmentTenantGroupScopeParameterSet

Remove-RdsRoleAssignment
    -RoleDefinitionName <string>
    -GroupObjectId <string>
    -AADTenantId <string>
    -TenantGroupName <string>
    [<CommonParameters>]

GroupRoleAssignmentTenantScopeParameterSet

Remove-RdsRoleAssignment
    -RoleDefinitionName <string>
    -TenantName <string>
    [-GroupObjectId <string>]
    [-AADTenantId <string>]
    [-TenantGroupName <string>]
    [<CommonParameters>]

GroupRoleAssignmentHostPoolScopeParameterSet

Remove-RdsRoleAssignment
    -RoleDefinitionName <string>
    -TenantName <string>
    -HostPoolName <string>
    [-GroupObjectId <string>]
    [-AADTenantId <string>]
    [-TenantGroupName <string>]
    [<CommonParameters>]

GroupRoleAssignmentAppGroupScopeParameterSet

Remove-RdsRoleAssignment
    -RoleDefinitionName <string>
    -TenantName <string>
    -HostPoolName <string>
    -AppGroupName <string>
    [-GroupObjectId <string>]
    [-AADTenantId <string>]
    [-TenantGroupName <string>]
    [<CommonParameters>]

Description

Remove-RdsRoleAssignment cmdlet 通過指定角色分配的三個屬性(角色、主體和範圍)來刪除角色分配。

要定義角色,您可以使用以下參數之一:

  • RDS 擁有者
  • RDS 貢獻者
  • RDS 讀取器
  • RDS作員

要指定委託人,您可以使用以下參數之一:

  • 登錄名稱
  • ApplicationId
  • 組物件ID

要定義範圍,您可以使用以下參數的組合:

  • 租戶組名稱
  • 租戶名稱
  • HostPool名稱
  • AppGroupName 應用程式組名稱

範例

範例 1:刪除使用者的角色分配

PS C:\> Remove-RdsRoleAssignment -RoleDefinitionName "RDS Owner" -SignInName "admin@contoso.com" -TenantGroupName "Default Tenant Group" -TenantName "contoso" -HostPoolName "contosoHostPool" -AppGroupName "Desktop Application Group"

此命令將刪除在「桌面應用程式組」應用程式組範圍內分配給 RDS 擁有者角色的使用者的角色分配 admin@contoso.com 。

範例 2:刪除服務主體的角色分配

PS C:\> Remove-RdsRoleAssignment -RoleDefinitionName "RDS Reader" -ApplicationId "yyyy-yyyy-yyyy-yyyy-yyyy" -TenantGroupName "contosoTenantGroup" -TenantName "contosoA" -HostPoolName "contosoAHostPool"

此命令將刪除指定服務主體的角色分配,該服務主體在「contosoAHostPool」主機池範圍內分配給 RDS Reader 角色。

範例 3:刪除 Azure AD 組的角色分配

PS C:\> Remove-RdsRoleAssignment -RoleDefinitionName "RDS Operator" -GroupObjectId "aaaa-aaaa-aaaa-aaaa-aaaa" -TenantGroupName "contosoTenantGroup" -TenantName "contosoA"

此命令將刪除分配給「contosoA」租戶範圍內的 RDS作員角色的指定 Azure AD 組的角色分配。

參數

-AADTenantId

使用者的 Azure Active Directory 租戶 ID。 在租戶組範圍內分配使用者時,這是必需的。 在租戶、主機池或應用組範圍內分配使用者時,如果與 Windows 虛擬桌面租戶關聯的 Azure AD 租戶中不存在這些使用者,則也需要這樣做。

參數屬性

類型:String
預設值:None
支援萬用字元:False
不要顯示:False

參數集

SignInNameRoleAssignmentDeploymentScopeParameterSet
Position:Named
必要:True
來自管線的值:False
來自管線按屬性名稱的值:True
來自剩餘引數的值:False
SignInNameRoleAssignmentTenantGroupScopeParameterSet
Position:Named
必要:True
來自管線的值:False
來自管線按屬性名稱的值:True
來自剩餘引數的值:False
GroupRoleAssignmentDeploymentScopeParameterSet
Position:Named
必要:True
來自管線的值:False
來自管線按屬性名稱的值:True
來自剩餘引數的值:False
GroupRoleAssignmentTenantGroupScopeParameterSet
Position:Named
必要:True
來自管線的值:False
來自管線按屬性名稱的值:True
來自剩餘引數的值:False

-AppGroupName

應用組的名稱。

參數屬性

類型:String
預設值:None
支援萬用字元:False
不要顯示:False

參數集

(All)
Position:Named
必要:False
來自管線的值:False
來自管線按屬性名稱的值:True
來自剩餘引數的值:False

-ApplicationId

服務主體的應用程式ID。

參數屬性

類型:String
預設值:None
支援萬用字元:False
不要顯示:False
別名:服務主體名稱 (SPN), 服務主體名稱

參數集

ServicePrincipalParameterSet
Position:Named
必要:True
來自管線的值:False
來自管線按屬性名稱的值:True
來自剩餘引數的值:False

-Deployment

特定於 Windows 虛擬桌面的範圍。

參數屬性

類型:Switch
預設值:None
支援萬用字元:False
不要顯示:False

參數集

(All)
Position:Named
必要:False
來自管線的值:False
來自管線按屬性名稱的值:True
來自剩餘引數的值:False

-GroupObjectId

Azure AD 組的物件 ID。

參數屬性

類型:String
預設值:None
支援萬用字元:False
不要顯示:False
別名:用戶組物件ID

參數集

GroupObjectIdParameterSet
Position:Named
必要:True
來自管線的值:False
來自管線按屬性名稱的值:True
來自剩餘引數的值:False

-HostPoolName

主機池的名稱。

參數屬性

類型:String
預設值:None
支援萬用字元:False
不要顯示:False

參數集

(All)
Position:Named
必要:False
來自管線的值:False
來自管線按屬性名稱的值:True
來自剩餘引數的值:False

-RoleDefinitionName

角色的名稱。

參數屬性

類型:String
預設值:None
支援萬用字元:False
不要顯示:False

參數集

SignInNameParameterSet
Position:0
必要:True
來自管線的值:False
來自管線按屬性名稱的值:True
來自剩餘引數的值:False
ServicePrincipalParameterSet
Position:0
必要:True
來自管線的值:False
來自管線按屬性名稱的值:True
來自剩餘引數的值:False
GroupObjectIdParameterSet
Position:0
必要:True
來自管線的值:False
來自管線按屬性名稱的值:True
來自剩餘引數的值:False

-SignInName

使用者的使用者主體名稱 (UPN) 。

參數屬性

類型:String
預設值:None
支援萬用字元:False
不要顯示:False
別名:Email, 使用者主要名稱 (UserPrincipalName)

參數集

SignInNameParameterSet
Position:Named
必要:True
來自管線的值:False
來自管線按屬性名稱的值:True
來自剩餘引數的值:False

-TenantGroupName

租戶組的名稱。

參數屬性

類型:String
預設值:None
支援萬用字元:False
不要顯示:False

參數集

(All)
Position:Named
必要:False
來自管線的值:False
來自管線按屬性名稱的值:True
來自剩餘引數的值:False

-TenantName

租用戶的名稱。

參數屬性

類型:String
預設值:None
支援萬用字元:False
不要顯示:False

參數集

(All)
Position:Named
必要:False
來自管線的值:False
來自管線按屬性名稱的值:True
來自剩餘引數的值:False

CommonParameters

此 Cmdlet 支援一般參數:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 如需詳細資訊,請參閱 about_CommonParameters

輸入

System.String

輸出

System.Object