Solved

setting Target address in user Attribute

Posted on 2016-11-23
5
70 Views
Last Modified: 2016-11-24
Hello Team,

I have a list of users with SAM account name in CSV file and i need to update corrospond target address that is different for every user

Could you please suggest, how we can do it

Thanks,
Andy
0
Comment
Question by:Addy Nadia
  • 3
  • 2
5 Comments
 
LVL 5

Author Comment

by:Addy Nadia
ID: 41899186
like as a example.

if i have sam account name for below user

tadams  Target address is torrey.adams@xyz.com

So xyz.com is same for all user in target user but firstname.lastname is different

Thanks,
Andy
0
 
LVL 37

Accepted Solution

by:
Jian An Lim earned 500 total points
ID: 41900069
your csv file looks like his

samaccountname,targetaddress
tadams,torrey.adams@xyz.com

Open in new window



on your AD server you can run the following command

$file = import-csv c:\temp\user.csv 

foreach ($f in $file) {
get-aduser $f.samaccountname 
$targetaddress = $f.targetaddress

# set-aduser $f.samaccountname -add @{targetAddress = $_.targetAddress}
}

Open in new window

0
 
LVL 5

Author Comment

by:Addy Nadia
ID: 41900191
thanks so much, instead of set, suppose i want to check with GET command how to do that
0
 
LVL 37

Expert Comment

by:Jian An Lim
ID: 41900269
Sure

$file = import-csv c:\temp\user.csv 

foreach ($f in $file) {
get-aduser $f.samaccountname -properties targetaddress | select samaccountname,targetaddress

}

Open in new window

0
 
LVL 5

Author Closing Comment

by:Addy Nadia
ID: 41900283
Thank you so much
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Find out what you should include to make the best professional email signature for your organization.
How to resolve IMCEAEX NDRs in Exchange or Exchange Online related to invalid X500 addresses.
To show how to create a transport rule in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Mail Flow >> Rules tab.:  To cr…
This video demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to: http://www.codetwo.com/excha…

730 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