all - AD security group
Get-ADGroupMember all
Displays only "usernames":
Get-ADGroupMember all | Select SamAccountName
Snippet for Iterating through all users
$Users=Get-ADGroupMember all | Select SamAccountName
foreach ($User in $Users)
{
Write-Host $User.SamAccountName
}
No comments:
Post a Comment