Exchange command for some attributes

landfemail
landfemail used Ask the Experts™
on
Hi,
Is there a command that will get me all these attributes ?
First, last name, displayname, primary email address, UPN ,samaccountname,all others smtp address ,OU and status ( disabled or enabled)
Thank you.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Schnell SolutionsSystems Infrastructure Engineer

Commented:
Get-ADUser -Filter * -Property * | Select-Object -Property GivenName,SureName,DisplayName,EmailAddress,UserPrincipalName,SamAccountName,ProxyAddresses,DistinguishedName,Enabled

Author

Commented:
and is it possible to put in excel ?
Schnell SolutionsSystems Infrastructure Engineer

Commented:
Yeap, we can save on your desktop like this...

Get-ADUser -Filter * -Property * | Select-Object -Property GivenName,SureName,DisplayName,EmailAddress,UserPrincipalName,SamAccountName,ProxyAddresses,DistinguishedName,Enabled | Export-Csv -Path $Home\Desktop\MyUsers.csv
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Author

Commented:
proxy addresses gives me all information, is there another command for showing smtp addresses

Author

Commented:
Thank you but when i put it in cvs or txt file "surname" and "proxy addresses" shows as : Microsoft.ActiveDirectory.Management.ADPropertyValueCollection and no data on them.
Sr. Systems Administrator
Commented:
There is a VBScript I use to pull attributes from AD and put them into an Excel file. The excel file opens on your desktop and populates it automatically. (just minimize it while it runs. This version was modified to add UserPrincipalName and User Account Control to it (UAC of 512 is active, 514 is disabled. there are a few others) To give credit properly, I got the original script from Spiceworks https://community.spiceworks.com/scripts/show/402-export-ad-users-to-excel

I used this site to get the attributes to modify the file. http://www.kouti.com/tables/userattributes.htm

Hope it helps. Just rename the file to adusers.vbs and click it to run.
ADUsers.vbs.txt
Jeff GloverSr. Systems Administrator

Commented:
Oops. Small typo in the Script copy. Use this one instead
ADUsers.vbs.txt

Author

Commented:
Great script. thanks

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial