SyntaxFix
Write A Post
Hire A Developer
Questions
First, import the activedirectory module:
import-module activedirectory
Then issue this command:
Get-ADGroupMember -Identity $group | foreach-object { Write-Host $_.SamAccountName }
This will display the members of the specified group.