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.
  • 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 Feb 27 '18 at 0:46
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
}
  • 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 – xIIx PEGA xIIx Nov 20 '13 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. – xIIx PEGA xIIx Nov 20 '13 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 – xIIx PEGA xIIx Oct 21 '14 at 17:14
  • Updated the answer how you can loop through all site collaections – Remko Oct 22 '14 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 – xIIx PEGA xIIx Oct 30 '14 at 19:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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