none
SharePoint 2010 get list of site owners RRS feed

  • Question

  • Need a powershell script that will loop through all sites and subsites in a site collection that will get all owners with Full Control permissions.

    The reports should provide the following

    • The URL of the site with users with Full Control
    • The URL of the Parent Site if it is a subsite
    • Names of the Site Owners of the Parent

    I have researched numerous boards and scripts provided are either incomplete or do not even work.
    So if you respond and send me a link to another site please make sure it actually works.

    • Moved by jrv Wednesday, July 10, 2019 6:39 PM Correct forum
    Wednesday, July 10, 2019 1:34 PM

Answers

  • Hi 2013SharePoint,

    I tested this scripts on my SP 2010 and it works fine. Below powershell will get you list of all users with Full Control.

    asnp *SharePoint*
    Get-SPWebApplication -Identity http://portal.contoso.com/ | Get-SPSite -Limit All | Get-SPWeb -Limit All | 
    where { $_.HasUniquePerm -and $_.AssociatedOwnerGroup -ne $null } | 
    foreach { $weburl = $_.Url; $_ } | 
    Select -ExpandProperty AssociatedOwnerGroup | 
    Select -ExpandProperty Users | 
    Select {$weburl}, UserLogin, DisplayName

    And the below one will list all users who are Site Collection Administrators:

    asnp *SharePoint*
    Get-SPWebApplication -Identity http://portal.contoso.com/ | Get-SPSite -Limit All | Get-SPWeb -Limit All | 
    where { $_.HasUniquePerm } | 
    foreach { $weburl = $_.Url; $_ } | 
    Select -ExpandProperty Users | 
    Where { $_.IsSiteAdmin } | 
    Select {$weburl}, UserLogin, DisplayName
    Thanks & Regards,

    sharath aluri

    Thursday, July 11, 2019 2:00 AM