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/