3

Mostly when I export a list from AD I get the telephone number under the general tab. I would like to export a list containing First Name, Last name and all the phone numbers under both the general and telephone tabs.

Is there a way to do this?

-It's a 2008 R2 server

Best Regards Nikander

5

When exporting (unfortunately you do not specify which tool use) you specify which attributes you want to export. The names of the attributes and their compliance with ADUC GUI Tool can be found in the this article.

You need attributes:

givenName,sn,telephoneNumber,pager,mobile,facsimileTelephoneNumber,ipPhone

But they can be added (hidden under the "other" buttons):

otherHomePhone,otherPager,otherMobile,otherFacsimileTelephoneNumber,otherIpPhone

PowerShell export example to csv:

get-aduser -Filter * -property * | Select givenName,sn,telephoneNumber,pager,mobile,facsimileTelephoneNumber,ipPhone | Export-CSV -Encoding UTF8 phones.csv

CSVDE export example:

csvde -r "(&(objectClass=user)(objectCategory=person))" -l givenName,sn,telephoneNumber,pager,mobile,facsimileTelephoneNumber,ipPhone -f phones.csv
2

With powershell:

get-aduser -Filter * -property * | Select GivenName, SN, Officephone, HomePhone, pager, Fax, ipPhone

the computer where you run this from should have RSAT tools installed or be a DC

  • To export to CSV file: get-aduser -Filter * -property * | Select GivenName, SN, Officephone, HomePhone, pager, Fax, ipPhone | Export-CSV C:\Temp\ADExport.csv – Mikael Dyreborg Hansen Dec 2 '16 at 12:43
  • 2
    Hi, you can use the edit buttopn to add this to your original answer and use the backtick to mark your code samples serverfault.com/editing-help#code :-) – BlueCompute Dec 2 '16 at 12:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.