top of page

PowerShell - Get ALL AD users, full name and group memberships to screen

  • Writer: Jon Boyette
    Jon Boyette
  • Mar 1, 2022
  • 1 min read

Save as a self name .ps1, this parses the full name, username, and groups the AD users are a member of, I would recommend an export-csv c:\temp\ADUserInfo.csv -NoTypeInformation, an out-file or out-grid just seems way more messy

$ADGroupList = Get-ADGroup -Filter * | Select Name -ExpandProperty Name | Sort Name

ForEach($Group in $ADGroupList)

{

$members=Get-ADGroupMember -Identity $Group | Select Name, SAMAccountName | Sort

ForEach($member in $members)

{

Write-Host ($member.Name + "," + $member.SAMAccountName + "," + $Group.name)

}

}


 
 
 

Recent Posts

See All
PowerShell - List All Domain SPNs

Save as same List_ALL_SPNs.ps1 or similar, this LDap calls the Domain for all Service Principal names and accounts related #Build LDAP...

 
 
 
PowerShell - Start-Monitoring

This is a great script used to Monitor and Email if a server is up or down, once ran, and smtp and from address is set, then run:...

 
 
 

Comments


Post: Blog2 Post
  • Facebook
  • Twitter
  • LinkedIn

©2022 by Boyette Technical Services. Proudly created with Wix.com

bottom of page