Solved

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

Posted on 2009-04-07
4
441 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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Suggested Solutions

Disabling the Directory Sync Service Account in Office 365 will stop directory synchronization from working.
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
To show how to generate a certificate request 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 Servers >> Certificates…
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…

773 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