一、模拟范围
(一)设置模拟范围
1、Name范围
New-ManagementScope -Name:"testNameScope" -RecipientRestrictionFilter "Name -eq 'ddgjtest1'"
2、CustomAttribute自定义属性范围
New-ManagementScope -Name:testCustomAttribute1Scope -RecipientRestrictionFilter "CustomAttribute1 -eq 'true'"
3、其他范围详见以下链接
Get-ManagementScope
(三)删除模拟范围
Remove-ManagementScope "模拟范围名称"
二、模拟
(一)设置模拟
1、设置模拟全部用户
New-ManagementRoleAssignment –Name:testImpersonation –Role:ApplicationImpersonation -User:testUser
2、使用模拟范围设置模拟
New-ManagementRoleAssignment –Name:testImpersonation –Role:ApplicationImpersonation -User:testUser –CustomRecipientWriteScope:testCustomAttribute1Scope
(二)删除模拟
Get-ManagementRoleAssignment -RoleAssignee "testUser" -Role "ApplicationImpersonation" -Delegating
$false | Remove-ManagementRoleAssignment
根据提示输入:y 回车