VBscript to add multiple email addresses to a User Object

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