zoukankan      html  css  js  c++  java
  • 使用Powershll 取出List中Item的权限

    #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
                }
            }
        }
    }    
  • 相关阅读:
    asp.net web生命周期
    图的数据结构1
    最长公共子串
    内部排序

    棋盘覆盖问题
    队列
    矩阵连乘问题
    图的数据结构2
    旅行售货员问题
  • 原文地址:https://www.cnblogs.com/batter152/p/4244262.html
Copyright © 2011-2022 走看看