A few days back I needed to find out whether the System account (SharePoint\System) was a member of a particular group and it turns out that this cannot be done from the GUI as it doesn't show up in the list of accounts that are members of that group so ... PowerShell to the rescue.
The following snippet will provide a list of users belonging to the desired group <Group Name>:
The following snippet will provide a list of users belonging to the desired group <Group Name>:
$site = Get-SPSite -WebApplication "<url>" $mainsite = (Get-SPWeb -Site $site)[0] $group = $mainsite.SiteGroups | ?{$_.Name -match "<Group Name>"} foreach($user in $group.Users){$user}As usual it needs to be run from the SharePoint PowerShell console or the Sharepoint PowerShell snap in needs to be loaded before running the above commands.
Doesn't work as you have a group object with an empty collection of users.
ReplyDeleteUsers : {}
Sorry it's my designer group that is returning empty other groups have users properties set. Don't understand why designers returns empty but it does?
ReplyDelete