Solved

how to change existing user's email address in AD user General tab?

Posted on 2009-04-07
4
451 Views
Last Modified: 2012-05-06
hi ,
 i have to change 300 users email adddress from "user@abc.com" to "user@xyz.com". i founf some vb script on net as below and i'm need script with clear ouput and prooved one.

SCript:
_________________________________________________________________
Set objParent = GetObject("LDAP://OU=ePortal,DC=testad,DC=com")

objparent.Filter = Array("user")



for each objUser in objParent

  'Wscript.Echo "Modifying " & objUser.Get("sAMAccountName")

      objUser.put "mail", objUser.Get("sAMAccountName") & "@efg.com"


      objuser.put "proxyAddresses", "SMTP:" & objUser.Get("sAMAccountName") & "@email.efg.com"

      objuser.EmployeeType = "AD"

      objUser.put "UserPrincipalName", objUser.Get("sAMAccountName") & "@efg.com"

objuser.Setinfo

 next

Wscript.Echo "Done ;)"
_______________________________________________________
0
Comment
Question by:gokulakrishnanns
  • 2
  • 2
4 Comments
 
LVL 6

Accepted Solution

by:
WizardWill earned 50 total points
ID: 24094493
Use admodify vaialble here http://www.codeplex.com/admodify

To do what you need read this article from the link below ---go to heading
Adding a new secondary SMTP address -- just make sure you tick set to primary


http://www.activedir.org/Articles/tabid/54/articleType/ArticleView/articleId/45/Default.aspx
0
 
LVL 6

Expert Comment

by:WizardWill
ID: 24094503
The best way to add new seconday SMTP addresses is to use Exchange Recipient Policies.  However, sometimes you just want to assign a new SMTP address to everyone within a particular OU.  Because Exchange Recipient Policies are (in Exchange 2000 and 2003 at least) based on LDAP queries, you cant select users within an OU as part of an LDAP query.  ADModify allows you do this, which provides a nice workaround to the Recipient Policies limitation.
0
 

Author Comment

by:gokulakrishnanns
ID: 24113459
hi WizardWill,

Actually i had already tested with Admodify which is not helped forme that's why i went for the script.. but i have tried one more time as per the article but still no gain...

my requirement is just update in user's properties "GENERAL " TAB i replace xxx@abc.com with xxx@xyz.com.. Totally i have 800 users in child domains also in which i have to do 300 users and reamining users has been changed already...


0
 

Author Comment

by:gokulakrishnanns
ID: 24154069
Hi All,

can i have soem updates for the last query......?

"Actually i had already tested with Admodify which is not helped forme that's why i went for the script.. but i have tried one more time as per the article but still no gain...

my requirement is just update in user's properties "GENERAL " TAB i replace xxx@abc.com with xxx@xyz.com.. Totally i have 800 users in child domains also in which i have to do 300 users and reamining users has been changed already..."
0

Featured Post

Free Webinar: AWS Backup & DR

Join our upcoming webinar with experts from AWS, CloudBerry Lab, and the Town of Edgartown IT to discuss best practices for simplifying online backup management and cutting costs.

Question has a verified solution.

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

Utilizing an array to gracefully append to a list of EmailAddresses
Learn to move / copy / export exchange contacts to iPhone without using any software. Also see the issues in configuration of exchange with iPhone to migrate contacts.
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

733 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