I had a script who get all users of sharepoint site. So I can get group for each member but can you get all group of sharepoint site and get all users of each group?


1 Answer 1


Use the following PowerShell script for getting all users for each SP group for given SPWeb

  $web = Get-SPWeb "http://YourWebURL/"
  foreach ($group in $web.groups){
write-host -foregroundcolor white "----Collecting users from group:"$group.Name "..."
foreach($user in $group.users) {
  if ($user.Loginname.StartsWith("SHAREPOINT\")) {continue}
  if ($user.Loginname.StartsWith("NT")) {continue}

  write-host -foregroundcolor Yellow "-------User:"$user.DisplayName

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.