Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: LDAP
Can you point me in the right direction with using ADSI with Exchange.
If the ADSPath =
ADsPath = StrCat("LDAP://%server1%/cn=Recipients,OU=",Site,",O=",Org)How would I then get a list of users and property values of a user (i.e. SMTP address)
Also, if anyone has used the ADSI extender to create mailboxes, would very much appreciate it if an example could be posted.
You could try the following:
; Recipient container object's path RecipPath = "LDAP://%server%/cn=Recipients,OU=%Site%,O=""%Org%""" ; Create a new mailbox sMailBoxPath = dsCreateObj(RecipPath, "organizationalPerson", "cn=%suserName%") ; Set mailbox properties. dsSetProperty(sMailBoxPath, "mailPreferenceOption", 0) dsSetProperty(sMailBoxPath, "givenName", sFirstName) dsSetProperty(sMailBoxPath, "sn", sLastName) dsSetProperty(sMailBoxPath, "cn", sDisplayName) dsSetProperty(sMailBoxPath, "uid", sAlias) dsSetProperty(sMailBoxPath, "Home-MTA", sMTA) dsSetProperty(sMailBoxPath, "Home-MDB", sMDB) dsSetProperty(sMailBoxPath, "mail", sSMTPAddr) dsSetProperty(sMailBoxPath, "MAPI-Recipient", @True) : Might need to use "true" sInitial1 = strsub(sFirstName, 1, 1) sInitial2 = strsub(sLastName, 1, 1) dsSetProperty(sMailBoxPath, "TextEncodedORaddress", "c=%COUNTRY%;a=;p=%Org%;o=%Site%;s=%sLastName%;g=%sFirstName%;i=%sInitial%%sInitial2%;") dsSetProperty(sMailBoxPath, "rfc822Mailbox", sSMTPAddr) ; Commit the mailbox. dsSetObj(sMailBoxPath)
Article ID: W14515
Filename: Exchange with ADSI.txt
File Created: 2000:11:28:12:36:56
Last Updated: 2000:11:28:12:36:56