SMTP Port 25

Anything and Everything Related to Messaging and Collaboration, Active Directory and Scripting. It’s My Life!!!

Posts Tagged ‘add multipe email address’

VBscript to add multiple email addresses to a User Object

Posted by Krishna - MVP on March 10, 2009

Below is the script to add multiple email address to a object. If you wanted to add 100′s of email address as alias address for some reason to a individual then below is the code to do the same.

Const ADS_PROPERTY_APPEND = 3
Set objUser = GetObject (“LDAP://path of the user“)

Set filesys = CreateObject(“Scripting.FileSystemObject”)
set filetxt = filesys.openTextfile(“c:\Names.txt”,1)
do until filetxt.AtEndofStream
 name = filetxt.readline
 name = trim(name)
 objUser.PutEx ADS_PROPERTY_APPEND, “proxyAddresses”, Array(“smtp:” & name)
 objUser.SetInfo

Loop

Posted in VB Scripts | Tagged: , , , | 1 Comment »

 
Follow

Get every new post delivered to your Inbox.

Join 52 other followers