Solved

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

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

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Exchange 2013 logs for troubleshooting mailflow 3 36
Can't send to contact 6 42
exchange out of office 8 40
Move mailbox to new database 9 12
ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
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.
how to add IIS SMTP to handle application/Scanner relays into office 365.
This video demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to: http://www.codetwo.com/excha…

920 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now