Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1519
  • Last Modified:

How Can I Add an bulk an Email Address to the proxyAddresses Attribute of all users in an OU.

How Can I Add an bulk an Email Address to the proxyAddresses Attribute of all users in an OU via script?

I wan to use the same mailnickname as their current primary smtp address, I just want to add a secondary with the new mail domain. Some of the users in the OU already have the address, over half do not. How can I add it to the users that do not?
0
Studio720
Asked:
Studio720
  • 3
  • 2
  • 2
  • +1
1 Solution
 
Justin DurrantSr. Engineer - Windows Server/VirtualizationCommented:
0
 
Studio720Author Commented:
I saw this article, but my question about this is given the sample:

Const ADS_PROPERTY_APPEND = 3

Set objUser = GetObject _
    ("LDAP://cn=KenMyer,ou=Finance,dc=fabrikam,dc=com")

objUser.PutEx ADS_PROPERTY_APPEND, "proxyAddresses", _
    Array("kenmyer@northamerica.fabrikam.com ")

Can I change it to:

Const ADS_PROPERTY_APPEND = 3

Set objUser = GetObject _
    ("LDAP://ou=Finance,dc=fabrikam,dc=com")

objUser.PutEx ADS_PROPERTY_APPEND, "proxyAddresses", _
    Array("*@northamerica.fabrikam.com ")

to add the the mailnickname + @northamerica.fabrikam.com to all users of the Finance OU?
0
 
Justin DurrantSr. Engineer - Windows Server/VirtualizationCommented:
that should work... try on a test OU first
0
Making Bulk Changes to Active Directory

Watch this video to see how easy it is to make mass changes to Active Directory from an external text file without using complicated scripts.

 
Studio720Author Commented:
This did not work for me.
0
 
Studio720Author Commented:
Can somebody help me with the example above to add a proxyaddress to all recipients in the Finance OU.
0
 
Henrik JohanssonSystems engineerCommented:
To script the objects in an OU, you nead to collect the OU as a recordset and loop through each object in the recordset.

As question is stated, it sounds like you nead to configure a recipient policy
http://support.microsoft.com/kb/319201
0
 
ach_patilCommented:
There is another easy way to do it. Instead of scripting you can use ADModify to add the proxy address.

Download it from here
http://www.codeplex.com/admodify
Tutorial
http://www.activedir.org/Articles/tabid/54/articleType/ArticleView/articleId/45/Default.aspx

Run it and select your OU... Select all users for whom you need to add the email address. In the Email Addresses tab. Add the format of the SMTP address you need. Click on Go.

I would suggest you first try it on a Test OU
0
 
ach_patilCommented:
Glad it helped..

To avoid adding the SMTP address manualy everytime a user iscreated, You can also create an Email Recipient policy based on the criteria you need. This way the SMTP address is added automatically

If you are using Exchange 2003, heres how you can do it.
http://www.computerperformance.co.uk/exchange2003/exchange2003_recipient_policy.htm
http://www.msexchange.org/tutorials/Implementing-Custom-Recipient-Policies.html
0
 
Henrik JohanssonSystems engineerCommented:
As I already have suggested recipient policy, I wonder why http:#22725004 isn't accepted/included as part of solution?
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 3
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now