Quantcast
Channel: SharePoint 2010 - Setup, Upgrade, Administration and Operations forum
Viewing all articles
Browse latest Browse all 13778

Get permissions using powershell

$
0
0

We have several site collections that use a specific managed path.
Each site collection has exactly one library in it and within that library is a folder.
I need to go through each site collection where site URL like http://server/path/ and report (output-file) the AD groups that have access (read only or contribute). I need to do this recursively so that I capture the folder which has unique permissions (inheritance is broken).

I do not need to loop through the members of the AD group thankfully.

So the output may look something like:
server/path/site1/library1
ADgroup1 - read only
ADgroup2 - contribute
server/path/site1/library1/folder1
ADgroup3 - contribute
.....
server/path/site2/library2
etc....

Anyone able to lend a hand with the script.
I have the task of reporting all the permissions to my manager and don't feel like clicking through 50-60 sites collecting the info!

Here is what I have so far

$file = 'c:\teams.csv'
foreach($site in Get-SPSite -Identity "http://server/team/*" -limit all)
{
   foreach($web in $site.AllWebs)
   {
        $web.Url | Out-File -FilePath $file -append
        Get-SPUser -web $web | Where { $_.IsDomainGroup } | format-wide  | Out-File -FilePath $file -append
   }
}


Viewing all articles
Browse latest Browse all 13778

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>