Get list of all users present in a site under different SharePoint Groups
Background: I wanted to see all users who have access to the SharePoint site and belongs to which SharePoint group. Solution: Below SharePoint powershell script helps me to get list of users group wise- $site = Get-SPSite <Provide Site Collection URL here> $web = $site.OpenWeb() $groups = $web.sitegroups foreach ($grp in $groups) { "Group: " + $grp.name; $groupName = $grp.name write-host "Group: " $groupName -foregroundcolor green foreach ($user in $grp.users) { "User: " + $user.name write-host "User " $user.UserLogin -foregroundcolor red } } Usage: Navigate to Script location and type below command- GetUsers.ps1 This will sh...