对于有多级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. IIS7下配置SSAS通过HTTP远程连接

    淘宝 问答 学院 博客 资源下载 高端培训                  登录 注册                                   全部问题 文章 话题 人物         ...

  2. maven中文乱码问题——编译错误

    新建了个web应用,用maven配置的. Java源代码采用了utf-8编码格式. 本地编译打包,报错误.   由于系统默认编码是GBK,因此需要采用utf-8来编译. 采用如下方式: 在pom中添加 ...

  3. Surface Shader

    Surface Shader: (1)必须放在SubShdader块,不能放在Pass内部: (2)#pragma sufrace surfaceFunction lightModel [option ...

  4. Unity 模型导入导出

    从3DMAX导出,参考: http://tieba.baidu.com/p/2807225555 -> 使用3dmax 2013,会自带导出 fbx 的功能 -> 从 3dmax 导出 - ...

  5. multi-CPU, multi-core and hyper-thread--转

    原文地址:http://stackoverflow.com/questions/680684/multi-cpu-multi-core-and-hyper-thread Multi-CPU was t ...

  6. Xcode-快捷键大全

    1. 文件CMD + N: 新文件CMD + SHIFT + N: 新项目CMD + O: 打开CMD + S: 保存CMD+OPt+S:保存所有文件CMD + SHIFT + S: 另存为CMD + ...

  7. [git]安装git-pylint-commit-hook提高python项目中的代码质量

    什么是'git-pylint-commit-hook' 我在工作中,团队为了保证代码和提高代码的质量,要求每个项目都要求安装git-pylint-commit-hook,它是个钩子,会在你提交代码到本 ...

  8. [git]用pelican搞一个自己的blog(已完成)

    pelican Pelican Static Site Generator, Powered by Python:Pelican是python语言写的静态网站生成器.因为我一直打算用github pa ...

  9. 帮助你在 Photoshop 中轻松实现长阴影效果的工具

    扁平化设计正被用于各个主流的移动操作系统以及许多流行的网站,这是一个不断上升的趋势. 这种趋势有其分支,其中之一是“长阴影 “的效果在元素上的使用. 采用角度为 45 度的投影,给对象添加了一份立体感 ...

  10. Gradle学习系列之十——自定义Plugin(本系列完)

    在本系列的上篇文章中,我们讲到了如何自定义Task类型,在本篇文章中,我们将讲到如何自定义Plugin. 请通过以下方式下载本系列文章的Github示例代码: git clone https://gi ...