0

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?

Thanks

2

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
}
  }
  $web.Dispose()

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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