您的位置:首页 > 其它

使用Powershll 取出List中Item的权限

2015-01-26 10:16 288 查看
#Write-Host "Loading SharePoint Powershell Snapin..."
#Add-PSSnapin "Microsoft.SharePoint.Powershell"
$spWeb = Get-SPWeb -Identity http://xxxxxxxx $spList = $spWeb.GetList("xxxxxx")
#取第一条数据
$spListItemCollection = $spList.GetItemById(1)

Write-Host $spListItemCollection.Count

$spListItemCollection[1].RoleAssignments
#遍历查询的Item
foreach ($item in $spListItemCollection)
{
#遍历所有的Role
foreach($roleAssignment in $item.RoleAssignments)
{
#遍历Role中绑定的权限
foreach($definition in $role.RoleDefinitionBindings)
{
#取出权限是读的Role
if($definition.Name -eq "Read")
{
Write-Host $roleAssignment.Member ": "  $definition.Name
}
}
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: