|
|
|
date: Wed, 31 May 2006 16:30:42 -0400,
group: microsoft.public.exchange2000.active.directory.integration
back
Object doesn't support this property or method: 'objUser.CreateMailbox'
Hi, I'm having trouble setting up mailboxes in exchange 2003. I'm currently
building a asp web page where HR department can use to create a new hire in
active directory and a mailbox. When I run it in vbscript as a stand alone
program, everything works as supposed to, however, when I run it on asp
server, it keeps giving me this error:
----------------------------------------------------------------------------
---------
Microsoft VBScript runtime error '800a01b6'
Object doesn't support this property or method: 'objUser.CreateMailbox'
----------------------------------------------------------------------------
---------
Also, it won't let me set password as it creates a new user. It says one or
more parameter is wrong. I strongly believe it's not an authority issue. Can
anybody point me in the right direction?
---------------------------------------------------------------------------
---------------------------
strOU = Request.Form("ouMenu")
strPath = "LDAP://ou=" & strOU & ",dc=testdomain,dc=com"
strAdmin = "testdomain\*****"
strPass = "*****"
strFirstName = Request.Form("firstName")
strLastName = Request.Form("lastName")
strFullName = strFirstName + " " + strLastName
strFirstInitial = left(strFirstName,1)
strAccountName = LCase(strFirstInitial + strLastName)
strEmailAddr = strAccountName & "@testdomain.com"
strHomeMDB = "LDAP://CN=Mailbox Store (TESTSERVER)," & _
"CN=First Storage Group," & _
"CN=InformationStore, CN=TESTSERVER," & _
"CN=Servers," & _
"CN=First Administrative Group," & _
"CN=Administrative Groups, CN=EXCHANGE," & _
"CN=Microsoft Exchange, CN=Services," & _
"CN=Configuration, DC=testdomain, DC=com"
Set objNamespace = GetObject("LDAP:")
Set objPath = objNamespace.OpenDSObject(strPath,strAdmin,strPass,0)
Set objUser = objPath.Create("user","cn=" & strFullName)
objUser.Put "sAMAccountName", strAccountName
objUser.Put "userPrincipalName", strAccountName & "@testdomain.com"
objUser.SetInfo
objUser.GetInfo
objUser.SetPassword "password" <<=== For some reason this part doesn't
work
objUser.AccountDisabled = False
objUser.FirstName = strFirstName
objUser.LastName = strLastName
objUser.PasswordRequired = true <<=== Won't work
objUser.CreateMailbox strHomeMDB <<=== This part gives me the error
message
objUser.SetInfo
date: Wed, 31 May 2006 16:30:42 -0400
author: Yunki
Re: Object doesn't support this property or method: 'objUser.CreateMailbox'
Does the web server have the ESM tools loaded on it? If not, you need to
so you can use CDOEXM interfaces.
What is the exact error when trying to set the password?
--
Joe Richards Microsoft MVP Windows Server Directory Services
Author of O'Reilly Active Directory Third Edition
www.joeware.net
---O'Reilly Active Directory Third Edition now available---
http://www.joeware.net/win/ad3e.htm
Yunki wrote:
> Hi, I'm having trouble setting up mailboxes in exchange 2003. I'm currently
> building a asp web page where HR department can use to create a new hire in
> active directory and a mailbox. When I run it in vbscript as a stand alone
> program, everything works as supposed to, however, when I run it on asp
> server, it keeps giving me this error:
>
> ----------------------------------------------------------------------------
> ---------
> Microsoft VBScript runtime error '800a01b6'
>
> Object doesn't support this property or method: 'objUser.CreateMailbox'
> ----------------------------------------------------------------------------
> ---------
>
> Also, it won't let me set password as it creates a new user. It says one or
> more parameter is wrong. I strongly believe it's not an authority issue. Can
> anybody point me in the right direction?
>
> ---------------------------------------------------------------------------
> ---------------------------
>
> strOU = Request.Form("ouMenu")
> strPath = "LDAP://ou=" & strOU & ",dc=testdomain,dc=com"
> strAdmin = "testdomain\*****"
> strPass = "*****"
> strFirstName = Request.Form("firstName")
> strLastName = Request.Form("lastName")
> strFullName = strFirstName + " " + strLastName
> strFirstInitial = left(strFirstName,1)
> strAccountName = LCase(strFirstInitial + strLastName)
> strEmailAddr = strAccountName & "@testdomain.com"
>
>
> strHomeMDB = "LDAP://CN=Mailbox Store (TESTSERVER)," & _
> "CN=First Storage Group," & _
> "CN=InformationStore, CN=TESTSERVER," & _
> "CN=Servers," & _
> "CN=First Administrative Group," & _
> "CN=Administrative Groups, CN=EXCHANGE," & _
> "CN=Microsoft Exchange, CN=Services," & _
> "CN=Configuration, DC=testdomain, DC=com"
>
>
> Set objNamespace = GetObject("LDAP:")
> Set objPath = objNamespace.OpenDSObject(strPath,strAdmin,strPass,0)
>
>
> Set objUser = objPath.Create("user","cn=" & strFullName)
> objUser.Put "sAMAccountName", strAccountName
> objUser.Put "userPrincipalName", strAccountName & "@testdomain.com"
> objUser.SetInfo
>
>
> objUser.GetInfo
> objUser.SetPassword "password" <<=== For some reason this part doesn't
> work
> objUser.AccountDisabled = False
> objUser.FirstName = strFirstName
> objUser.LastName = strLastName
> objUser.PasswordRequired = true <<=== Won't work
> objUser.CreateMailbox strHomeMDB <<=== This part gives me the error
> message
> objUser.SetInfo
>
>
date: Wed, 31 May 2006 17:49:34 -0400
author: Joe Richards [MVP]
|
|