3

I'm looking for a PowerShell script that would display or create a report of the security configuration of a site collection. Any help would be appreciated.

It would list:

  • Site Collection Owners
  • Each group and it’s owner
  • Each group’s permission level
  • Each permission level and which of the check boxes are checked.
1
  • I don't have an answer, however have a follow on question, if I have AD rights to admin the SharePoint but don't have remote desktop access, is there anyway to wrap this script to get it to ask me for permission and run it locally on my PC? If not I need to go to my network staff and get rights, I am just the application admin in this case... TIA -KJ
    – user74252
    Commented Feb 27, 2018 at 0:46

1 Answer 1

8

PowerShell is ideal for this. You can use something like this get the information you want.

$siteUrl = "http://.." 
$site = Get-SPSite $siteUrl
$site.RootWeb.SiteAdministrators
$site.RootWeb.SiteGroups | Select Name, Owner, Roles
$site.RootWeb.RoleDefinitions | Select Name, BasePermissions

If you want to loop through all webapplication you could use code like

Get-SPWebApplication | Get-SPSite -Limit All | % {
    $site = $_
    $site.RootWeb.SiteAdministrators
    $site.RootWeb.SiteGroups | Select Name, Owner, Roles
    $site.RootWeb.RoleDefinitions | Select Name, BasePermissions
}
7
  • Thanks this does exactly what I need. Now is there any way to get it to export to any kind of file instead of you displaying it? @Remko Commented Nov 20, 2013 at 14:44
  • Never mind I was able to export it to a file, now just working on getting it display correctly. Thanks again for your help. Commented Nov 20, 2013 at 15:24
  • Is there any to make this script pull the information for all site collections in a farm? I've tried to set it up but haven't had much luck. @Remko Commented Oct 21, 2014 at 17:14
  • Updated the answer how you can loop through all site collaections
    – Remko
    Commented Oct 22, 2014 at 5:45
  • One more thing. How can I get it to display the site collection url or Title? I posted the current code I'm using. @Remko Commented Oct 30, 2014 at 19:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.