I've recently created a "new employee" form that creates accounts, mailboxes,
and the like.
On my development box (xp pro), the code works fine. However, now that I am
trying to move the code to the production server (2003), I am running into
the following error.
Invalid Cast Specified (see comment for line)
Here is the code
Dim objMailbox As CDOEXM.IMailboxStore
Dim objADSIuser As ActiveDs.IADsUser
'Bind User to AD
objADSIuser = GetObject(ADSIUserPath)
objMailbox = objADSIuser 'HAPPENS ON THIS LINE!
objMailbox.CreateMailbox("LDAP://" & DCServer & "/" & _
"CN=Mailbox Store (" & DCServer1 & ")," & _
"CN=Blah," & _
"CN=InformationStore," & _
"CN=" & DCServer1 & "," & _
"CN=Servers," & _
"CN=blah," & _
"CN=Administrative Groups," & _
"CN=blah," & _
"CN=Microsoft Exchange," & _
"CN=Services," & _
"CN=Configuration," & DomainName)
objADSIuser.SetInfo()
Please advise!


Reply With Quote