I added an AD security group in a sharepoint site. I want to list the users in this group. I want to do this in SP server instead of AD. Have anyone done this before? Could this be achieved through powershell? Please kindly advice.
You could try the following powershell script to achieve this:
$web=get-spweb http://yoursite
$ADGroup = $web.EnsureUser("ADGroup")
$reachedMax = $false
$users =[Microsoft.SharePoint.Utilities.SPUtility]::GetPrincipalsInGroup($web, $ADGroup
, 10,[ref]$reachedMax)
$users
You can use below commands: Replace the asterisk (*) with the Security Group
Display on Screen:
Get-ADGroupMember -identity "*" | Select Name
Export to CSV:
Get-ADGroupMember -identity "*" | Select Name | Export-CSV -Path C:\Windows\Temp\SecurityGroups.csv -NoTypeInformation
Link Source: http://itnutt.com/powershell-list-members-of-ad-security-group/