Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

copy attribute "office" to exchange custom attribute 1

Posted on 2014-03-28
3
Medium Priority
?
625 Views
Last Modified: 2016-05-06
I am in need of a script to batch copy an AD user's "office" field into "ExchangeCustomAttribute1" for that same user.

I've found this page: but it is for AD and not exchange:

http://blogs.technet.com/b/ashleymcglone/archive/2012/07/23/how-to-copy-user-attributes-to-another-field-with-powershell.aspx

I'm looking for some help to get this written. Any ideas?
0
Comment
Question by:lbc_matt
[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
  • 2
3 Comments
 
LVL 71

Accepted Solution

by:
Chris Dent earned 2000 total points
ID: 39963681
Exchange lives in Active Directory, changes you make there will be reflected in Exchange. You just need to know the LDAP names of the attributes you have in mind. Those are:

Office = physicalDeliveryOfficeName
Exchange Custom Attribute 1 = extensionAttribute1

Which means you should be able to do this:
Get-ADUser -LDAPFilter '(physicalDeliveryOfficeName=*)' -Properties physicalDeliveryOfficeName, extensionAttribute1 |            
  Select-Object * -First 5 |            
  ForEach-Object {
    Set-ADObject -Identity $_.DistinguishedName -Replace @{extensionAttribute1=$($_.physicalDeliveryOfficeName)}
  }

Open in new window

Note: You will need to run "Import-Module ActiveDirectory" and either run it on a system with admin tools already installed, or install RSAT.

HTH

Chris
0
 

Expert Comment

by:DENG225
ID: 41582079
When I execute this script nothing happens and I am left looking at a flashing cursor?
0
 
LVL 71

Expert Comment

by:Chris Dent
ID: 41582161
Left at a ">>" prompt? If so, press return again and it should start running.

Chris
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

A recent project that involved parsing Tableau Desktop and Server log files to extract reusable user queries for use in other systems. I chose to use PowerShell to gather the data, and SharePoint to present it...
In previous parts of this Nano Server deployment series, we learned how to create, deploy and configure Nano Server as a Hyper-V host. In this part, we will look for a clustering option. We will create a Hyper-V cluster of 3 Nano Server host nodes w…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Screencast - Getting to Know the Pipeline

610 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