Powershell Remove "Limited Access" - 金大昊(jindahao)

对于有多级web获取getlist会报错:Exception calling “GetList” with “1” argument

$SPWeb = Get-SPWeb -Identity http://192.168.0.50:81/oasite/
#注意getlist的写法
$list = $SPWeb.GetList("/oasite/Lists/Facilities and Shared Assets")
$item = $list.Items| where{ $_.Name -eq "北京10F第五会议室"} $return = $item.RoleAssignments |where {$_.RoleDefinitionBindings -eq $SPWeb.RoleDefinitions["受限访问"]}; foreach ($i in $return)
{
Write-Host "Removing: " $i.Member;
$item.RoleAssignments.Remove($i.Member);
}

断开权限继承

$SPWeb = Get-SPWeb -Identity http://192.168.0.50:81/oasite/
$list = $SPWeb.GetList("/oasite/Lists/Facilities and Shared Assets") $item = $list.Items| where{ $_.Name -eq "北京10F第五会议室"}
$item.BreakRoleInheritance(true) $return = $item.RoleAssignments |where {$_.RoleDefinitionBindings -eq $SPWeb.RoleDefinitions["受限访问"]}; foreach ($i in $return)
{
Write-Host "Removing: " $i.Member;
$item.RoleAssignments.Remove($i.Member);
}
上一篇:TCP协议下的服务端并发,GIL全局解释器锁,死锁,信号量,event事件,线程q


下一篇:OpenStack neutron vlan 模式下的网络包流向