I have created a sample VBScript that will add a Custom Recipient to
Exchange without the use of Exchange Admin.  This script relates to Imail
because after creating an Imail account I need to create a CR in Exchange
for the Imail user.  The other option was import/export of CSV....kinda
sloppy.  The InputBox lines could be replaced with variables from a single
input screen in VB.

My entire process will be to write an app that will prompt for all the info,
then create and NT account (automatically adding the Imail user), update the
Imail LDAP server, and then add a custom recipient to Exchange.  I like
VBS's size, speed and ease of use.

this line will have to be changed in the script to fit your server:
Set objCont =
GetObject("LDAP://server/cn=Recipients,ou=unit,o=organization")

The use of ADSI Explorer can really help in filling out the above line if
you don't understand directories, which is located at
http://www.intouchsoftware.com.

You will need ADSI which can be found at:
http://www.microsoft.com/windows2000/library/howitworks/activedirectory/adsi
links.asp.

I hope this can help someone.

Mike

I hope I didn't leave anything out......

++++++++++++++++

' These are all the fields from the property page of a custom recipient.
' A secondary email address could also be added easily.

Dim strFirstname
Dim strLastname
Dim strDisplayname
Dim strAlias
Dim strpostalAddress
Dim strI
Dim strst
Dim strpostalCode
Dim strco
Dim strtitle
Dim strCompany
Dim strdepartment
Dim strPhysicalDeliveryOfficeName
Dim strsecretary
Dim strTelephone
Dim strTargetAddress
Dim strrfc822Mailbox
Dim objCont
Dim objNewCR

strFirstname = InputBox("Enter the First Name:")
strLastname = InputBox("Enter the Last Name:")
strDisplayname = strlastName + ", " + strfirstName
strAlias = Inputbox("Enter the Alias (UserID):")
strpostalAddress = InputBox("Enter Address:")
strl = InputBox("Enter City:")
strst = InputBox("Enter State:")
strpostalCode = InputBox("Enter Zip Code:")
strco = InputBox("Enter Country:")
strtitle = InputBox("Enter Title:")
strCompany = InputBox("Enter Company:")
strdepartment = InputBox("Enter Department:")
strPhysicalDeliveryOfficeName = InputBox("Enter Facility Number:")
strsecretary = InputBox("Enter Assistant:")
strTelephone = Inputbox("Enter the Phone Number (000-000-0000):")
strrfc822Mailbox = InputBox("Enter the SMTP Address:")
strTargetAddress = "SMTP:" + strrfc822Mailbox

nRtnVal = msgbox("Process the Record?", 1)

If rtnval <> 2 Then
        'change the line below to fit your Exchange Server
        Set objCont =
GetObject("LDAP://server/cn=Recipients,ou=unit,o=organization")
        Set objNewCR = objCont.Create("Remote-Address", CStr("cn=" &
strAlias))
        objNewCR.Put "givenName", CStr(strFirstname)
        objNewCR.Put "sn", CStr(strLastname)
        objNewCR.Put "cn", CStr(strdisplayname)
        objNewCR.Put "uid", CStr(stralias)
        objNewCR.Put "postalAddress", CStr(strpostalAddress)
        objNewCR.Put "l", CStr(strl)
        objNewCR.Put "st", CStr(strst)
        objNewCR.Put "postalCode", CStr(strpostalCode)
        objNewCR.Put "co", CStr(strco)
        objNewCR.Put "title", CStr(strtitle)
        objNewCR.Put "Company", CStr(strCompany)
        objNewCR.Put "Department", CStr(strDepartment)
        objNewCR.Put "PhysicalDeliveryOfficeName",
CStr(strPhysicalDeliveryOfficeName)
        objNewCR.Put "secretary", CStr(strsecretary)
        objNewCR.Put "telephoneNumber", CStr(strTelephone)
        objNewCR.Put "Target-Address", CStr(strTargetAddress)
        objNewCR.Put "rfc822Mailbox", CStr(strrfc822mailbox)
        objNewCR.Setinfo
End If

        
Please visit http://www.ipswitch.com/support/mailing-lists.html 
to be removed from this list.

Reply via email to