对于有多级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);
}

Powershell Remove "Limited Access" - 金大昊(jindahao)的更多相关文章

  1. 移动,企业社交(sharepoint2013)--jindahao(金大昊)

    MobileIncreasingly, a major component of sharing and collaborating involves mobile access. SharePoin ...

  2. 导出你的GAC Assembly中的DLLS -- 金大昊(jindahao)

    导出你的GAC Assembly中的DLLS   方法1: CMD命令中,进入C:\windows\assembly,然后XCOPY GAC_MSIL c:\temp /E 这样就得到了dlls了,以 ...

  3. PowerShell Remove all user defined variable in PowerShell

    When PS scripts executes, it is possibly create much user defined variables. So, sometimes these var ...

  4. Remove “Quick Access” entry in Eclipse Juno

    Here is a quick hack which doesn't require any plugin installation, instead you just need to add a f ...

  5. sharepoint 开发相关工具总结

    1.CAML Designer 2013 开发caml用 http://biwug-web.sharepoint.com/SitePages/Caml_designer.aspx 2.SharePoi ...

  6. sharepoint获取exchange邮箱报错:该帐户无权模拟所请求的用户

    现象: sharepoint获取exchange邮箱报错:该帐户无权模拟所请求的用户 处理办法: 1.Open the Exchange Management Shell 2.输入: New-Mana ...

  7. sharepoint 2013 文件“/_controltemplates/SPMRB/AllStatBookingsForm.ascx”不存在

    现象: 文件“/_controltemplates/SPMRB/AllStatBookingsForm.ascx”不存在. 分析: 此代码在sp2010好用,但是在sp2013则报以上错误. 解决办法 ...

  8. SharePoint2013 - 移动文档

    In SharePoint 2010, the easiest way to transfer documents from one library to another involved using ...

  9. facebook api之Access and Authentication

    Access and Authentication There are three access levels to the Marketing APIs. You can upgrade acces ...

随机推荐

  1. ODBC连接问题

    http://zhidao.baidu.com/link?url=EPEMTuGC1q5wWavZigWseoHOwRLvpHyAVsdIgMLspErJOUZMEepIICUnT9IdkPQlYTm ...

  2. ruby -- 问题解决(三)编码错误导致无法显示(1)

    从数据库中取得数据显示时报 incompatible character encodings: GBK and ASCII-8BIT 或 incompatible character encoding ...

  3. 后端码农谈前端(HTML篇)第一课:HTML概述

    一.什么是HTML? HTML不是编程语言,是用来描述网页文档(页面结构)的一种标记语言: HTML指超文本标记语言(Hyper Text Markup Language),之所以称为超文本标记语言, ...

  4. GNOME3任务栏、标题栏过宽问题

    Debian 7.0 默认安装的是GNOME 3.4.2桌面系统,缺省状态下,用户会发现桌面系统的桌面任务栏及标题栏宽度太大,影响美观,同时也浪费屏幕显示的有效宽度,针对这个问题我们可以通过以下方式进 ...

  5. 【转载】C/C++ 函数指针 总结

    转载自:http://blog.csdn.net/shihui512/article/details/9787125 什么是函数指针函数指针的声明函数指针的赋值函数指针的使用将函数作为其他函数的参数在 ...

  6. cmd 窗口配置mysql数据库

    1.运行-cmd 进入command 窗口 首先cd 到mysql目录下的bin的 路运行-cmd 进入command 窗口 首先cd 到mysql目录下的bin的路径.注意cd D盘时直接输入D:就 ...

  7. redis的备份

    了解redis的朋友应该知道它有两种数据持久化的方式,这里我作一个简单的介绍,AOF(append only  file)和RDB. 1.RDB 这是一种比较常见的方式,采用 写时复制 的方式,效率高 ...

  8. 代码规范之争——[个人Week2作业]

    这四个问题均是出自 http://goodmath.scientopia.org/2011/07/14/stuff-everyone-should-do-part-2-coding-standards ...

  9. Spring MVC的web.xml配置详解(转)

    出处http://blog.csdn.net/u010796790 1.spring 框架解决字符串编码问题:过滤器 CharacterEncodingFilter(filter-name) 2.在w ...

  10. 用Qt写软件系列三:一个简单的系统工具之界面美化

    前言 在上一篇中,我们基本上完成了主要功能的实现,剩下的一些导出.进程子模块信息等功能,留到后面再来慢慢实现.这一篇来讲述如何对主界面进行个性化的定制.Qt库提供的只是最基本的组件功能,使用这些组件开 ...