?
Solved

Windows 2008 R2 Enterprise AD

Posted on 2014-01-27
6
Medium Priority
?
353 Views
Last Modified: 2014-03-03
I have a windows 2008 R2 enterprise server as a DC. I need to modify the proxy address in the attribute editor for 1000 AD accounts. I would like to do this via a script as a bulk import.

Any ideas
0
Comment
Question by:James Danahay
[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
6 Comments
 
LVL 31

Expert Comment

by:Gareth Gudger
ID: 39814190
Are you referring to a Proxy Address in Internet Explorer? If so, you can use Group Policy Management Console to create a group policy for this change. Then just apply that policy to the OU where these AD accounts are located.
0
 
LVL 4

Expert Comment

by:pcmghouse
ID: 39814824
Are you talking about
get-aduser -filter * -properties proxyaddresses|fl name,proxyaddresses
0
 

Author Comment

by:James Danahay
ID: 39816636
Yes I'm trying to add the proxyaddress in the AD user proxyaddresses
0
Office 365 Training for IT Pros

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

 
LVL 4

Expert Comment

by:pcmghouse
ID: 39817000
import-module activedirectory
get-aduser testuser -properties proxyaddresses|fl name,proxyaddresses|out-file -append c:\temp\oldproxyaddresses.txt
$addproxyaddress="smtp:testuser2@contoso.com"
set-aduser testuser -add @{proxyaddresses=$addproxyaddress}
get-aduser testuser -properties proxyaddresses|fl name,proxyaddresses|out-file -append c:\temp\newproxyaddresses.txt

The above powershell code has 5 lines. Replace testuser with one of your users and test it. You need domain admin privileges.

Once you are comfortable with the above code, you can loop thru each user. Also we may need to modify the $addproxyaddress as each user may have a different one.
0
 

Author Comment

by:James Danahay
ID: 39828257
Great code - works well

How do I loop through each user as I have about 800 users?
0
 
LVL 4

Accepted Solution

by:
pcmghouse earned 1000 total points
ID: 39828776
import-module activedirectory
$users = Get-ADUser -filter * -properties proxyaddresses
Foreach ($user in $users)
{
"Proxyaddresses: " + $user.proxyaddresses | out-file -append c:\temp\oldproxyaddresses.txt
"DN: " + $user.distinguishedname | out-file -append c:\temp\oldproxyaddresses.txt
"==================================================================" | out-file -append c:\temp\oldproxyaddresses.txt
$addproxyaddress = "smtp:" + $user.samaccountname + "2@contoso.com"
set-aduser -identity $user.samaccountname -add @{proxyaddresses=$addproxyaddress}
}

Testing:
The above code should help you. Test it before using it.
Modify the first line like this to test:
$users = Get-ADUser -filter {samaccountname -like "*jdanahay*"} -properties proxyaddresses

You can comment the set-aduser line and check the log file to see the list of users that will be modified. Put a hash like this:
#set-aduser -identity $user.samaccountname -add @{proxyaddresses=$addproxyaddress}
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

A procedure for exporting installed hotfix details of remote computers using powershell
After seeing many questions for JRNL_WRAP_ERROR for replication failure, I thought it would be useful to write this article.
To efficiently enable the rotation of USB drives for backups, storage pools need to be created. This way no matter which USB drive is installed, the backups will successfully write without any administrative intervention. Multiple USB devices need t…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…
Suggested Courses

752 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