error 800a01b6 - When creating mailbox from ASP web page


I've created an ASP web page to create Active Directory user accounts.

The web page is running on a Server 2003 SP2 IIS 6 installation.
The Exchange Server is 2003 w/SP2 is running in a different server.

The Exchange System Manager is running on the web server.

The web page uses ADSI code to create a user, and then CDO code to create
the mailbox e.g.

Set objRootLDAP = GetObject("LDAP://rootDSE")
strDefaultNamingContext = objRootLDAP.Get("defaultNamingContext")
Set objContainer = GetObject("LDAP://" & strContainer & objRootLDAP.Get("defaultNamingContext"))
Set objUser = objContainer.Create("User", "cn=" & strUser)

objUser.Put <set all the user info>

objuser.CreateMailbox <string representing MTA>

Now, when I connect to this site using my domain admin credentials, it
works fine. However, if a user I have created for this purpose connects to this site, the user account is successfully created in AD but upon reaching the "CreateMailbox" line, he gets

Microsoft VBScript runtime error '800a01b6'
Object doesn't support this property or method

The person who is going to be using this page can't have full Administrative rights over the domain, only User and Mailbox creation rights.

Thanks for any help you can provide me!
Who is Participating?
AQNSYSAuthor Commented:
Hi SatyaPathak,
This is the advice from that link:

Although .vbs scripts can contain CDOEXM calls like
CreateMailbox, such a call in an ASP script is unsupported.

They advise to create a COM+ object that included the create mailbox
functionality and call it from the ASP page. (Unfortunatelly I don't know COM+)

Alternative solution.
Create two separate scripts, one which is the existing ASP script that does everything but create the mailbox, and then run a scheduled task on the web server that is a VBS script that looks for
accounts without mailboxes in a certain OU, creates the mailbox, and puts the account in a "Finished Account" OU.

This last solution I could implement, but then I'm risking running into the problem of somebody that wants to create a user in a hurry using the web page, the user will be created but the mailbox will take some time depending on the schedule I give the script with the "create mailbox" procedure.

Does anybody has a different solution to this issue?

AQNSYSAuthor Commented:
Although the solution provided can be implemented, there is still one issue that it does not address.
All Courses

From novice to tech pro — start learning today.