Scripting help - need to get phone number of AD accounts and then add them to contacts in trusted domain

Posted by TheCleaner on Server Fault See other posts from Server Fault or by TheCleaner
Published on 2012-03-29T20:51:32Z Indexed on 2012/03/29 23:32 UTC
Read the original article Hit count: 235

I have domain accounts that I have created as contacts in another trusted domain so that they can see them in their Exchange GAL.

I need a way to extract the phone number field from UserA (user account) in DomainA and import it into UserA (contact) in DomainB.

I get the logic, it's just the code (vbscript/powershell/whatever) that eludes me.

The logic as I see it:

  1. Connect to source AD (ou/subtree)
  2. Extract user accounts from OU and subcontainers including first name, last name, display name, and phone number
  3. Connect to target AD (ou/subtree)
  4. Verify/match contact with extract in #2 above based on display name
  5. Update phone field with phone number in extract
  6. Write log of success and failures

Anybody able to help?

© Server Fault or respective owner

Related posts about active-directory

Related posts about powershell