SimonBrook
asked on
Export primary SMTP and Business Phone from AD.
Can anyone provide a script to create a CSV file which lists all users, their primary SMTP and their business phone number pulled from AD?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi,
Thanks for these. However I would like first/surname in a field in the CSV instead of the account name.
What amendments would I need to make?
Thanks,
Thanks for these. However I would like first/surname in a field in the CSV instead of the account name.
What amendments would I need to make?
Thanks,
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If you would prefer Mikes option, I'm sure the command would be something like:
adfind -default -f "&(objectcategory=person)( objectclas s=user)" givenName sn telephonenumber mail -nodn -csv > c:\users.csv
adfind -default -f "&(objectcategory=person)(
That is exactly right to add those attributes, you can have it list any attribute. If you want to know what the attributes are behind the GUI this is a good page
http://www.selfadsi.org/user-attributes-w2k3.htm
Thanks
Mike
http://www.selfadsi.org/user-attributes-w2k3.htm
Thanks
Mike
All you need to do is change Example.Local to match you NB Domain Name, use notepad to save the script to something like FindUsers.vbs, and then run from the command line: CScript FindUsers.vbs
Open in new window