RobZimmerman
asked on
PowerShell script to display all email addresses where the department = X
Hi everyone,
Very new to powershell and at this point I need to punt and just ask for the command here. What I have so far is:
Get-ADUser -Filter * -Properties EmailAddress, Department | select EmailAddress, Department
What I ultimately need to do is filter it to where Department = Logistics and so on and so forth.
I really appreciate your help,
Mike
Very new to powershell and at this point I need to punt and just ask for the command here. What I have so far is:
Get-ADUser -Filter * -Properties EmailAddress, Department | select EmailAddress, Department
What I ultimately need to do is filter it to where Department = Logistics and so on and so forth.
I really appreciate your help,
Mike
ASKER
This is awesome, thank you! I should have added that I need to add the ability to export this to a csv, will a "Export-Csv c:\ps_test\test.txt" work?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
This should give you what you are looking for.
Dan