Exchange command for some attributes

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.
landfemailAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Schnell SolutionsSystems Infrastructure EngineerCommented:
Get-ADUser -Filter * -Property * | Select-Object -Property GivenName,SureName,DisplayName,EmailAddress,UserPrincipalName,SamAccountName,ProxyAddresses,DistinguishedName,Enabled
0
landfemailAuthor Commented:
and is it possible to put in excel ?
0
Schnell SolutionsSystems Infrastructure EngineerCommented:
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
0
Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

landfemailAuthor Commented:
proxy addresses gives me all information, is there another command for showing smtp addresses
0
landfemailAuthor 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.
0
Jeff GloverSr. Systems AdministratorCommented:
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
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Jeff GloverSr. Systems AdministratorCommented:
Oops. Small typo in the Script copy. Use this one instead
ADUsers.vbs.txt
1
landfemailAuthor Commented:
Great script. thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Exchange

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.