0

I am trying to find PowerShell scripts that do the following:

  1. List all TeamSites.

  2. List all TeamSites, Groups that belong to that TeamSite with their permissions.

  3. List all TeamSites, Groups that belong to that TeamSite with their permissions as well as the users that belong to those groups (grouped by group).

This would be for SharePoint online.

Is this possible? Any help would be greatly appreciated.

1 Answer 1

0

PowerShell script for Getting all the sites from Site-collection and groups under each site.

    $sites = Get-SPOSite -Detailed;
    foreach($site in $sites)
    {
      Write-Host $site.Title
      $groups = Get-SPOSiteGroup -Site $site;
      foreach($grp in $groups)
      {
        Write-Host $site.Title
      }
    }

And The below script is for Getting Permissions for the Group.

Get-SPOSiteGroup -SiteName https://xxx.sharepoint.com/sites/mysitecollection | FT Title, Roles -AutoSize

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.