[Snippet]: Fetch User Name and Email Address from Windows AD Group using Powershell script.

FetchAdUsers.ps1

#Store users' info in CSV

Get-ADGroupMember -Identity GROUPNAME -Recursive|Get-ADUser -Properties Mail, MemberOf | Select-Object GivenName, Surname, SamAccountName, Mail  | Export-csv -path GROUPNAME .csv -NoTypeInformation

Comments

Popular posts from this blog

[Code Snippet] Assert Exception in private methods using PrivateObject

Update WPF Interaction Triggers in from .Net Framework 4.8 to .Net 5

[Code snippet] How to set value of private variable in Unit Test Using Reflection ?