Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mailbox Creation 1

Status
Not open for further replies.

fredclown

Programmer
Aug 15, 2005
7
US
I work for a school and every year we have an influx of new students. We don't want to manually create AD user accounts and mailboxes for each student ... so we decided to automate the process. We can create the AD accounts fine. The trouble comes in creating the exchange 2003 mailbox. I'm running an asp page under a domain user account that has the permissions to create a mailbox. The script I have works great as a WSH Script, but when I copy the script verbatim into and asp page running under the same user as I ran the WSH Script it doesn't work (I ran both the WSH and the ASP on the exchange server itself). The below is the script code and the error I get any clues. I'm stumped.
Code:
*** Error ***
Error Type:
(0x80070057)
/Stuff/Stuff.asp, line 79

Code:
*** Code ***
strLoginName = "me"
strMail = strLoginName & "@mydomain.edu"
strhomeMDB = "CN=Mail Store,CN=A Storage Group,CN=InformationStore,CN=My Server,CN=Servers,CN=My Org,CN=Administrative Groups,CN=My Org,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=mydomain,DC=dom"

Set objPerson = CreateObject("CDO.Person")
objPerson.DataSource.Open ("LDAP://CN=" & strLoginName	& ",OU=My OU,DC=mydomain,DC=dom"), ,3
Set mbox = objPerson.GetInterface("IMailboxStore")
mbox.CreateMailbox strhomeMDB <----- ***** This is the error line *****
objPerson.Email = strMail
objPerson.Fields.Update
objPerson.DataSource.Save
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top