?
Solved

Exporting AD Contacts with Powershell

Posted on 2010-11-16
9
Medium Priority
?
8,329 Views
Last Modified: 2012-05-10
Hi,
I'm currently trying to migrate our company's 1000+ mail contacts from Exchange into a contacts list in Sharepoint.

I need specific data from Active Directory for each contact which goes beyond what the Get-MailContact cmdlet can do.  I need info like Company, phone number...etc...

I downloaded Quest's tools, but it seems like their cmdlets are only for users, not contacts.

Any ideas?
0
Comment
Question by:jamorlando
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +1
9 Comments
 
LVL 27

Accepted Solution

by:
KenMcF earned 668 total points
ID: 34150223
try this with quest, you can add other attributes as needed.

get-qadobject -type contact | select Name, PrimarySMTPAddress | export-csv contacts.csv
0
 
LVL 35

Assisted Solution

by:Joseph Daly
Joseph Daly earned 664 total points
ID: 34150678
Another method of doing this would to use the CSVDE command. I have done this in the past using the command below.

csvde.exe -r "(&(objectCategory=person)(objectClass=user)(mail=*))" -l "objectClass, displayName,givenName,sn,DN,mail,mailnickname,mobile,telephoneNumber,facsimileTelephoneNumber,title," -f "c:\export.csv"

There are alot of attributes we wanted returned but you can use as many or few as you like.
0
 
LVL 49

Assisted Solution

by:Akhater
Akhater earned 668 total points
ID: 34154500
you don't need quest tools just use the get-contact cmdlet instead the get-mailcontact you will find all the missing attributes you are looking for


for a full list of attributes get-contact 'contact name' | fl

get-contact -resultsize unlimited | select-object name,Phone,company | export-csv contacts.csv
0
Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 

Author Comment

by:jamorlando
ID: 34154979
@KenMcF, thanks, I will try to tweak this to my needs

@xxdcmast, wow, never heard of the csvde.exe command, but that's pretty sweet that you can do this kind of thing from the command prompt instead of powershell.  If I can't get Ken's solution to work I'll check this out.

@Akhater, I see company, and phone, but what about an attribute like "Address" which is stored in AD?
0
 
LVL 49

Expert Comment

by:Akhater
ID: 34154998
you mean StreetAddress?

get-contact -resultsize unlimited | select-object name,Phone,company,streetaddress

again try with on one conact get-contact contactname | fl  and you will be able to find all properties
0
 

Author Comment

by:jamorlando
ID: 34155013
Actually Ken, when I run
Get-QADObject -type contact -Identity bjones | fl

I don't see an attribute for address either.  Is there a way to do this from quest?
0
 
LVL 49

Expert Comment

by:Akhater
ID: 34155041
here are the address attributes in get-contact


StreetAddress
PostOfficeBox
City
StateOrProvince
PostalCode
CountryOrRegion
0
 
LVL 27

Expert Comment

by:KenMcF
ID: 34155042
Try it with -includedproperties *

Get-QADObject -type contact -Identity bjones -includedproperties * | fl *
0
 

Author Comment

by:jamorlando
ID: 34155269
Thanks ... I got this figured out.  I'm going to give you guys all credit, cause all 3 of you were very helpful.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

My attempt to use PowerShell and other great resources found online to simplify the deployment of Office 365 ProPlus client components to any workstation that needs it, regardless of existing Office components that may be needing attention.
Group policies can be applied selectively to specific devices with the help of groups. Utilising this, it is possible to phase-in group policies, over a period of time, by randomly adding non-members user or computers at a set interval, to a group f…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Suggested Courses

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question