Link to home
Start Free TrialLog in
Avatar of landfemail
landfemailFlag for United States of America

asked on

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.
Avatar of Ogandos
Ogandos
Flag of Canada image

Get-ADUser -Filter * -Property * | Select-Object -Property GivenName,SureName,DisplayName,EmailAddress,UserPrincipalName,SamAccountName,ProxyAddresses,DistinguishedName,Enabled
Avatar of landfemail

ASKER

and is it possible to put in excel ?
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
proxy addresses gives me all information, is there another command for showing smtp addresses
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.
ASKER CERTIFIED SOLUTION
Avatar of Jeff Glover
Jeff Glover
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Oops. Small typo in the Script copy. Use this one instead
ADUsers.vbs.txt
Great script. thanks