Thursday, June 14, 2018
Monday, June 11, 2018
[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
#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
Subscribe to:
Posts
(
Atom
)