Created
May 13, 2015 19:24
-
-
Save beckettkev/76e3e66059346218cb03 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Break-SPWebInheritance($siteXmlFilePath) { | |
| $xml = Select-Xml -Path $siteXmlFilePath -XPath"//SiteStructure" | |
| $xml.Node.Web | ForEach-Object { | |
| Write-Host "Openning web for breaking inheritance ($($_.Url))" | |
| $web = $clientContext.Site.OpenWeb($_.Url) | |
| $web.BreakRoleInheritance($true, $true) | |
| $clientContext.ExecuteQuery() | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment