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

x
?
Solved

setting Target address in user Attribute

Posted on 2016-11-23
5
Medium Priority
?
515 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
[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
  • 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 2000 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

Looking for the Wi-Fi vendor that's right for you?

We know how difficult it can be to evaluate Wi-Fi vendors, so we created this helpful Wi-Fi Buyer's Guide to help you find the Wi-Fi vendor that's right for your business! Download the guide and get started on our checklist today!

Question has a verified solution.

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

On September 18, Experts Exchange launched the first installment of the Help Bell, a new feature for Premium Members, Team Accounts, and Qualified Experts. The Help Bell will serve as an additional tool to help teams increase question visibility.
As much as Microsoft wants to kill off PST file support, just as they tried to do with public folders, there are still times when it is useful or downright necessary to export Exchange mailboxes to PST files. Thankfully, it is still possible to e…
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 …
In this video we show how to create an Address List 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 Organization >> Ad…
Suggested Courses

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