0

Looking for a PowerShell command to list SharePoint subsites with users / security groups of each that have access to each.

1
  • Please tag the SharePoint version Feb 12, 2018 at 15:19

1 Answer 1

2
Add-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue

$oSite = Get-SPSite "https://webapp/sites/sitecoll"

foreach($oWeb in $oSite.AllWebs)
{
    foreach($grp in $oWeb.Groups)
    {        
        Write-Host $grp.Name
        Write-Host "-------"

        foreach($usr in $grp.users)
        {
            Write-Host $usr.DisplayName
        }
    }
}

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