Solved

setting Target address in user Attribute

Posted on 2016-11-23
5
43 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 36

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 36

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

Promote certifications in your email signature

Has your company recently won an award or achieved a certification? They'll no doubt want to show it off. Email signature images used to promote certifications & awards can instantly establish credibility with a recipient and provide you with numerous benefits.

Question has a verified solution.

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

Suggested Solutions

This article explains in simple steps how to renew expiring Exchange Server Internal Transport Certificate.
Read this checklist to learn more about the 15 things you should never include in an email signature.
In this video we show how to create a Distribution Group 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 Recipients >>…
In this video we show how to create a Resource Mailbox in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: Navigate to the Recipients >> Resources tab.: "Recipients" is our default selection …

911 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now