I am trying to get the following information from all my sites.

Site Name, Site URL, Users with Full Control(in groups or not), User Email

I am able to get the Site Name and Site URL with Powershell. Anybody know how to also get users with full control and their email? (I tried but couldn't get users that were in groups along with those who weren't and it was a separate script, want them combined in one excel doc.). Thanks.

1 Answer 1


You could try this powershell script Site Name, Site URL, Users with Full Control(in groups or not), User Email

  $web= Get-SPWeb $Url

    Write-Host $web.Title $web.Url-ForegroundColor red
    Foreach($role in $roles)
    if( $role.Name  -eq "Full Control"){
        Write-Host "permission level" $role.Name -ForegroundColor green
        Write-Host "group has this permission:"
        if($groups.Count -eq 0){
            Write-Host "no group has this permissoon" -ForegroundColor red
            Foreach($group in $groups)
             Write-Host $group
             if($groupUsers.Count -eq 0){
                Write-Host "this group does not has users"
                Foreach($groupUser in $groupUsers){
                Write-Host "User:" $groupUser "Email:"$groupUser.Email
        Write-Host "-------------"
        Write-Host "user has this permission:"
        $users = $role.Users 
        if($users.Count -eq 0){
            Write-Host "no user has this permissoon directly" -ForegroundColor red
            Foreach($user in $users)
             Write-Host "User:" $user "Email:"$user.Email

Test result: enter image description here

  • Hi Amos, Thanks for your reply. I need all of this in a spreadsheet. Is there anyway to get Site, SiteURL, User, UserEmail, Role Name all in one line? Nov 11, 2020 at 13:29
  • stackoverflow.com/questions/21047185/… You could refer to this issue to export data to csv, Some data has many values, I think the experience will not be very good.
    – Amos
    Nov 12, 2020 at 9:21

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.