Hey, Justin, I'm also using a script to create my Exh 5.5 mailboxes... This is what I'm doing : One advise... Wait a while to create your mailbox after creating your account....
' Get SID to allow link of NT account and Mailbox ' (Requires the ADSI tool kit - REGSVR32 ADSSECURITY.DLL ) Set oUser = CreateObject("ADsSID") oUser.SetAs ADS_SID_WINNT_PATH, "WinNT://" & PDC & "/" & strNTaccount & ",user" sidHex = oUser.GetAs(ADS_SID_HEXSTRING) ' Determine which server the user should be created AGILA(A->N) or EAGLE(O->Z) If asc(Ucase(Left(strLastname,1))) > 78 then MTA = "cn=Microsoft MTA,cn=EAGLE,cn=Servers,cn=Configuration,ou=TOC Mechelen,O=Telenet" MDB = "cn=Microsoft Private MDB,cn=EAGLE,cn=Servers,cn=Configuration,ou=TOC Mechelen,O=Telenet" Else MTA = "cn=Microsoft MTA,cn=AGILA,cn=Servers,cn=Configuration,ou=TOC Mechelen,O=Telenet" MDB = "cn=Microsoft Private MDB,cn=AGILA,cn=Servers,cn=Configuration,ou=TOC Mechelen,O=Telenet" End If Set oMail = GetObject(LDAP_MAIL) wscript.echo "Create Mailbox" '---Create a new MailBox--- Set omailBox = oMail.Create("organizationalPerson", "cn=" & strLastname & " " & strFirstName) oMailBox.Put "uid", Cstr(strLastname & " " & strFirstName) oMailBox.Put "mailPreferenceOption", 0 oMailBox.Put "givenName", Cstr(strFirstName) oMailBox.Put "sn", Cstr(strLastName) oMailBox.Put "cn", Cstr(strLastname & " " & strFirstName) oMailBox.Put "Home-MTA", Cstr(MTA) oMailBox.Put "Home-MDB", Cstr(MDB) oMailBox.Put "mail", Cstr(strEmail) oMailBox.Put "MAPI-Recipient", True oMailbox.Put "TextEncodedORaddress", "c=be;a=;p=TOC Mechelen;o=Telenet;s=" & strLastName & ";g=" & strFirstName & ";" oMailBox.Put "rfc822Mailbox", Cstr(strEmail) oMailBox.Put "Assoc-NT-Account", sidHex oMailbox.Put "info", "Created by batch script" ' Commit the property cache to the directory service oMailBox.SetInfo Regards -----Original Message----- From: SALANDRA, JUSTIN [mailto:[EMAIL PROTECTED]] Sent: woensdag 24 april 2002 18:42 To: '[EMAIL PROTECTED]' Subject: RE: [ActiveDir] ADC Programming But I am not using Exchange 2000, I am using Exchange 5.5. Thank you for the info though. I am sure it will be useful. -----Original Message----- From: Joe Sargent [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 24, 2002 12:34 PM To: [EMAIL PROTECTED] Subject: RE: [ActiveDir] ADC Programming I have had a lot of problems to get mailboxes created for Exchange 2000. My guess is your problem is the same. Mine was account password policies. You need to set the "userAccountControl" property to allow the user to be created with no password. That is done with this code.... ' enable password for user adsuserobject.Put "userAccountControl", 512 + 32 Then call your mailbox create procedure Then set the "userAccountControl" to back... ' enable password for user adsuserobject.Put "userAccountControl", 512 + 32 Then set your password..... ' set password adsuserobject.SetPassword "password" Below is the mailbox create procedure code that I got from CDOLIVE.com that I have modified for my use. Hope this helps. HTH JOE S. **************** Sub CreateMailbox (straduserobject,stremailaddress) Dim objExchangeServer ' As CDOEXM.ExchangeServer Dim objDNSInfo ' As ActiveDs.ADSystemInfo Dim objNTInfo ' As ActiveDs.WinNTSystemInfo Dim objRootDSE ' As ActiveDs.IADsContainer Dim objMailboxStore ' As CDOEXM.IMailboxStore Dim objRecipient ' As CDOEXM.IMailRecipient Dim objUser ' As ActiveDs.IADsUser Dim objContainer ' As ActiveDs.IADsContainer DIM strHomeMDBUrl DIM strServer DIM strExchSG DIM strExchAG DIM strExchOrg DIM strDomainName DIM strDNSDomainName Set objDNSInfo = CreateObject("ADSystemInfo") Set objNTInfo = CreateObject("WinNTSystemInfo") Set objRootDSE = GetObject("LDAP://RootDSE") strExchOrg = "WSCC" strExchAG = "First Administrative Group" strExchSG = "First Storage Group" strServer = objNTInfo.ComputerName strDNSDomainName = objDNSInfo.DomainDNSName strDomainName = objRootDSE.Get("defaultNamingContext") strHomeMDBUrl = "CN=Mailbox Store (" & strServer & "),CN=" & strExchSG & "," & _ "CN=InformationStore,CN=" & strServer & ",CN=Servers," & _ "CN=" & strExchAG & ",CN=Administrative Groups," & _ "CN=" & strExchOrg & ",CN=Microsoft Exchange,CN=Services,CN=Configuration," & strDomainName '"CN=First Organization,CN=Microsoft Exchange,CN=Services,CN=Configuration," & strDomainName Set objExchangeServer = CreateObject("CDOEXM.ExchangeServer") ' Err.Clear ' Get CDOEXM mailbox store interface from ADSI user Set objMailboxStore = straduserobject ' Get CDOEXM recipient interface from ADSI user Set objRecipient = straduserobject ' Set Exchange 2000 Server mailbox home database property 'Err.Clear 'WScript.Echo strHomeMDBUrl objMailboxStore.CreateMailbox strHomeMDBUrl ' Check for errors If Err.Number = 0 Then ' Save properties With straduserobject ' Make entry visible in Exchange address lists .Put "msExchHideFromAddressLists", FALSE 'save changes Err.Clear .SetInfo End With End If ' Check for errors 'If Err.Number = 0 Then ' Write mailbox restrictions With objMailboxStore ' Disable store defaults .EnableStoreDefaults = True ' Issue warning at (KB) '.StoreQuota = 1000 ' Prohibit send at (KB) '.OverQuotaLimit = 10000 ' Prohibit send and receive at (KB) '.HardLimit = 100000 End With with objRecipient 'set secondary email address .ProxyAddresses ="smtp:" & stremailaddress & "@domain.com" 'set default SMTP .SMTPEmail = stremailaddress & "@otherdomain.com" end with ' Set the delivery restriction settings and proxy addresses With objRecipient ' If either of these is -1, then the system defaults are being used ' Outgoing message size .OutgoingLimit = -1 ' Incoming message size .IncomingLimit = -1 End With ' Save properties straduserobject.SetInfo end sub -----Original Message----- From: SALANDRA, JUSTIN [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 24, 2002 12:13 PM To: '[EMAIL PROTECTED]' Subject: [ActiveDir] ADC Programming Importance: High Hello Everyone, Question for you all. I have the ADC installed from the Exchange 2000 CD on my Win2k Server DC. I have all the right CA's configured. I am trying to automate the creation of user accounts through a adsi and asp scripts. I can get the users created, but am having difficulty creating the mailboxes. Does anyone know the coding for creating mailboxes through AD for Exchange 5.5 using the ADC? Justin A. Salandra, MCSE Senior Network Engineer Catholic Healthcare System 914.681.8117 office 646.483.3325 cell [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> List info : http://www.activedir.org/mail_list.htm List FAQ : http://www.activedir.org/list_faq.htm List archive: http://www.mail-archive.com/activedir%40mail.activedir.org/ List info : http://www.activedir.org/mail_list.htm List FAQ : http://www.activedir.org/list_faq.htm List archive: http://www.mail-archive.com/activedir%40mail.activedir.org/ List info : http://www.activedir.org/mail_list.htm List FAQ : http://www.activedir.org/list_faq.htm List archive: http://www.mail-archive.com/activedir%40mail.activedir.org/ > ************************************************************* > Dit e-mail bericht inclusief eventuele ingesloten bestanden kan informatie > bevatten die vertrouwelijk is en/of beschermd door intellectuele > eigendomsrechten. Dit bericht is uitsluitend bestemd voor de > geadresseerde(n). Elk gebruik van de informatie vervat in dit bericht > (waaronder de volledige of gedeeltelijke reproductie of verspreiding onder > elke vorm) door andere personen dan de geadresseerde(n) is verboden. > Indien u dit bericht per vergissing heeft ontvangen, gelieve de afzender > hiervan te verwittigen en dit bericht te verwijderen. > > This e-mail and any attachment thereto may contain information which is > confidential and/or protected by intellectual property rights and are > intended for the sole use of the addressees. Any use of the information > contained herein (including but not limited to total or partial > reproduction or distribution in any form) by other persons than the > addressees is prohibited. If you have received this e-mail in error, > please notify the sender and delete its contents. > ************************************************************* > List info : http://www.activedir.org/mail_list.htm List FAQ : http://www.activedir.org/list_faq.htm List archive: http://www.mail-archive.com/activedir%40mail.activedir.org/