Invalid Cast (objMailbox = objADSIuser) CDOEXM.DLL
Exchange Server Forum Index Exchange Server
Discussion forums for Microsoft Exchange Server users.
Microsoft Outlook
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web ExchangeServerHelp.com
Invalid Cast (objMailbox = objADSIuser) CDOEXM.DLL

 
Post new topic   Reply to topic    Exchange Server Forum Index -> Development
Author Message
PokerJoker
Guest





Posted: Fri Dec 03, 2004 5:57 am    Post subject: Invalid Cast (objMailbox = objADSIuser) CDOEXM.DLL Reply with quote

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!

Back to top
PokerJoker
Guest





Posted: Mon Dec 06, 2004 11:05 pm    Post subject: RE: Invalid Cast (objMailbox = objADSIuser) CDOEXM.DLL Reply with quote

Nobody has any info?

"PokerJoker" wrote:

Quote:
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!
Back to top
 
Post new topic   Reply to topic    Exchange Server Forum Index -> Development All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server Dedicated Servers
New Topics Powered by phpBB