Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_cdo thread: probleme to create a mail box with exchange 2000 using script


Message #1 by =?iso-8859-1?q?mohamed=20bouraoui?= <mohbouraoui@y...> on Mon, 3 Jun 2002 10:07:20 +0200 (CEST)
--0-1965729556-1023091640=:72990
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit


 

hi, 

Thank you for the reponse, And I only wanted to say to you has what corresponds this error: 0x80040E21 in line 48
(objPerson.DataSource.SaveTo "LDAP://" & strServerName & "/CN=" & strEmailName & ",CN=users," & strDomainDN
& " " )?

If it is the problem of the security then where I give the administrator username and the password ?

Thank you a the next time!!

  Siegfried Weber <sweber@c...> a écrit : I've been looking twice but couldn't locate the lines 48 & 60 hence I am
note sure where the error happens. So far looking over the code I cannot
see any obvious errors.

Since it appears that you are running this on a French Windows &
Exchange machine you might want to check if the names for the
administrative group are not different.



> -----Original Message-----
> From: mohbouraoui@y... [mailto:mohbouraoui@y...]
> Sent: Monday, May 27, 2002 7:11 PM
> To: ASP CDO
> Subject: [asp_cdo] probleme to create a mail box with exchange 2000
using
> script
> 
> i'm trying to create new mailbox in exchange 2000. i can create a user
in
> the active directory using CDOEX, but i can't create mailbox and
generate
> me errors in line 48 and 60 (i use asp for creating new email) :
> the is the script when i use :
> 
> 
> 
> > 	Dim strServerName		' the server name, for
> example "MyServer6"
> 	Dim strDomainName		' the server's domain, for
> example "MYDOMAIN3.microsoft.com"
> 	Dim strExchangeOrg		' the Exchange organization
> housing the mailbox store. For example "First Organization"
> 	Dim strAdminGroup		' the Exchange administrative
> group name, for example "First Administrative Group"
> 	Dim strStorageGroup		' the storage group for the
> mailbox store, for example "First Storage Group"
> 	Dim strStoreName		' the mailbox store name, for
> example "Mailbox Store (SERVERNAME)"
> 	Dim strEmailName		' emailname    - the user's
email
> name, for example "jamessmith"
> 	Dim strFirstName		' the user's first name, for
> example "James"
> 	Dim strLastName			' the user's last name, for
> example "Smith"
> 	Dim objPerson			' object to hold CDO person
object
> 	Dim objMailbox			' object to hold IMailboxStore
> interface to person object
> 	Dim objLDAP				' object to hold LDAP
> domain name reponse
> 	Dim aryTokens
> 	Dim strPSURL
> 	Dim strDomainDN
> 
> 	Set objPerson = CreateObject("CDO.Person")
> 	strServerName = "MAILVOICE"
> 
> 'LAB: get the domain name for the current user ("administrator" for
this
> lab)
> 	Set objLDAP = GetObject("LDAP://rootdse")
> 	strDomainName = objLDAP.Get("dnshostname")
> 	strDomainName = Mid(strDomainName, InStr(strDomainName, ".") +
1)
> 
> 	strExchangeOrg = "organisation"
> '   change value to run on other exchange servers
> 	strAdminGroup = "First Administrative Group"
> 	strStorageGroup = "First Storage Group"
> 	strStoreName = "Mailbox Store (" & strServerName & ")"
> 	strEmailName = "mohlil"
> 	strFirstName = "mohlil"
> 	strLastName = "mohlil"
> 
> 	aryTokens = Split(strDomainName, ".", -1, 1)
> 	strDomainDN = Join(aryTokens, ",dc=")
> 	strDomainDN = "dc=" & strDomainDN   &  " "
> 
> 'LAB: Create the user in Active Directory
> 	objPerson.firstName = firstName
> 	objPerson.lastName = lastName
> 	objPerson.Fields("userPrincipalName") = lastName
> 	objPerson.Fields("userAccountControl") = 512
> 	objPerson.Fields("userPassword") = "password"
> 	objPerson.Fields.Update
> 	'objPerson.DataSource.SaveTo "LDAP://" & strServerName & "/CN="
<br>> strEmailName & ",CN=users," & strDomainDN & " "
> 
> 
> 
> 	Response.Write ("
")
> 	Response.Write "LDAP://" & strServerName & "/CN=" & strEmailName
> & ",CN=users," & strDomainDN
> 	Response.Write ("
")
> 
> 'LAB: create mailbox in specified location.
> 	strPSURL = "LDAP://" & strServerName & "/CN=" & strStoreName
> & ",CN=" & strStorageGroup & ",CN=InformationStore,CN=" <br>strServerName
> & ",CN=Servers,CN=" & strAdminGroup & "," & "CN=Administrative
Groups,CN="
> + strExchangeOrg & "," & "CN=Microsoft Exchange,CN=Services,"
> & "CN=Configuration," & strDomainDN
> 	Set objMailbox = objPerson.GetInterface("IMailboxStore")
> 	objMailbox.CreateMailbox strPSURL
> 	objPerson.DataSource.Save
> 
> 	Response.Write ("
")
> 	Response.Write ("
MailBox created for:  " <br>> strEmailName & "
")
> %>
> 
> 
> 
> Type error generate is:
> (0x80040E21)
> /affichedonne/creer.asp, line 48
> 
> and
> Type d'erreur :
> (0x80072030)
> /affichedonne/creer.asp, line 59
> 
> 
> 
> 
> please help me,
> thanks



---------------------------------
Yahoo! Mail -- Une adresse @yahoo.fr gratuite et en français !

Message #2 by "Siegfried Weber" <sweber@c...> on Mon, 3 Jun 2002 18:19:36 +0200
If DataSource.SaveTo fails the most common problem is indeed a 
permission issue. The point with CDOEXM is that you, like with ADSI, 
cannot pass security credentials into the SaveTo call. That means your 
application must run with a user account which has permissions to create 
the user.

Another issue you might face is a change in Exchange 2000 SP2 which 
requires some code changes as described here:

PRB: "80040E94" or "80040E09" Err Msg w/IDataSource.Save Method:
http://support.microsoft.com/default.aspx?scid=3Dkb;EN-US;q321039

<Siegfried />

> -----Original Message-----
> From: mohamed bouraoui [mailto:mohbouraoui@y...]
> Sent: Monday, June 03, 2002 10:07 AM
> To: ASP CDO
> Subject: [asp_cdo] probleme to create a mail box with exchange 2000 
using
> script
>
>
>
> hi,
>
> Thank you for the reponse, And I only wanted to say to you has what
> corresponds this error: 0x80040E21 in line 48 
(objPerson.DataSource.SaveTo
> "LDAP://" & strServerName & "/CN=3D" & strEmailName & ",CN=3Dusers," &
> strDomainDN & " " )?
>
> If it is the problem of the security then where I give the 
administrator
> username and the password ?
>
> Thank you a the next time!!
>
>   Siegfried Weber <sweber@c...> a =E9crit :
>
> 	I've been looking twice but couldn't locate the lines 48 & 60 hence
> I am
> 	note sure where the error happens. So far looking over the code I
> cannot
> 	see any obvious errors.
>
> 	Since it appears that you are running this on a French Windows &
> 	Exchange machine you might want to check if the names for the
> 	administrative group are not different.
>
>
>
> 	> -----Original Message-----
> 	> From: mohbouraoui@y... [mailto:mohbouraoui@y...]
> 	> Sent: Monday, May 27, 2002 7:11 PM
> 	> To: ASP CDO
> 	> Subject: [asp_cdo] probleme to create a mail box with exchange
> 2000
> 	using
> 	> script
> 	>
> 	> i'm trying to create new mailbox in exchange 2000. i can create a
> user
> 	in
> 	> the active directory using CDOEX, but i can't create mailbox and
> 	generate
> 	> me errors in line 48 and 60 (i use asp for creating new email) :
> 	> the is the script when i use :
> 	>
> 	> <%@ Language=3DVBScript %>
> 	>
> 	> <%
> 	> Dim strServerName ' the server name, for
> 	> example "MyServer6"
> 	> Dim strDomainName ' the server's domain, for
> 	> example "MYDOMAIN3.microsoft.com"
> 	> Dim strExchangeOrg ' the Exchange organization
> 	> housing the mailbox store. For example "First Organization"
> 	> Dim strAdminGroup ' the Exchange administrative
> 	> group name, for example "First Administrative Group"
> 	> Dim strStorageGroup ' the storage group for the
> 	> mailbox store, for example "First Storage Group"
> 	> Dim strStoreName ' the mailbox store name, for
> 	> example "Mailbox Store (SERVERNAME)"
> 	> Dim strEmailName ' emailname - the user's
> 	email
> 	> name, for example "jamessmith"
> 	> Dim strFirstName ' the user's first name, for
> 	> example "James"
> 	> Dim strLastName ' the user's last name, for
> 	> example "Smith"
> 	> Dim objPerson ' object to hold CDO person
> 	object
> 	> Dim objMailbox ' object to hold IMailboxStore
> 	> interface to person object
> 	> Dim objLDAP ' object to hold LDAP
> 	> domain name reponse
> 	> Dim aryTokens
> 	> Dim strPSURL
> 	> Dim strDomainDN
> 	>
> 	> Set objPerson =3D CreateObject("CDO.Person")
> 	> strServerName =3D "MAILVOICE"
> 	>
> 	> 'LAB: get the domain name for the current user ("administrator"
> for
> 	this
> 	> lab)
> 	> Set objLDAP =3D GetObject("LDAP://rootdse")
> 	> strDomainName =3D objLDAP.Get("dnshostname")
> 	> strDomainName =3D Mid(strDomainName, InStr(strDomainName, ".") +
> 	1)
> 	>
> 	> strExchangeOrg =3D "organisation"
> 	> ' change value to run on other exchange servers
> 	> strAdminGroup =3D "First Administrative Group"
> 	> strStorageGroup =3D "First Storage Group"
> 	> strStoreName =3D "Mailbox Store (" & strServerName & ")"
> 	> strEmailName =3D "mohlil"
> 	> strFirstName =3D "mohlil"
> 	> strLastName =3D "mohlil"
> 	>
> 	> aryTokens =3D Split(strDomainName, ".", -1, 1)
> 	> strDomainDN =3D Join(aryTokens, ",dc=3D")
> 	> strDomainDN =3D "dc=3D" & strDomainDN & " "
> 	>
> 	> 'LAB: Create the user in Active Directory
> 	> objPerson.firstName =3D firstName
> 	> objPerson.lastName =3D lastName
> 	> objPerson.Fields("userPrincipalName") =3D lastName
> 	> objPerson.Fields("userAccountControl") =3D 512
> 	> objPerson.Fields("userPassword") =3D "password"
> 	> objPerson.Fields.Update
> 	> 'objPerson.DataSource.SaveTo "LDAP://" & strServerName & "/CN=3D"
> 	&
> 	> strEmailName & ",CN=3Dusers," & strDomainDN & " "
> 	>
> 	>
> 	>
> 	> Response.Write ("
>
> 	")
> 	> Response.Write "LDAP://" & strServerName & "/CN=3D" & strEmailName
> 	> & ",CN=3Dusers," & strDomainDN
> 	> Response.Write ("
>
> 	")
> 	>
> 	> 'LAB: create mailbox in specified location.
> 	> strPSURL =3D "LDAP://" & strServerName & "/CN=3D" & strStoreName
> 	> & ",CN=3D" & strStorageGroup & ",CN=3DInformationStore,CN=3D" &
> 	strServerName
> 	> & ",CN=3DServers,CN=3D" & strAdminGroup & "," & 
"CN=3DAdministrative
> 	Groups,CN=3D"
> 	> + strExchangeOrg & "," & "CN=3DMicrosoft Exchange,CN=3DServices,"
> 	> & "CN=3DConfiguration," & strDomainDN
> 	> Set objMailbox =3D objPerson.GetInterface("IMailboxStore")
> 	> objMailbox.CreateMailbox strPSURL
> 	> objPerson.DataSource.Save
> 	>
> 	> Response.Write ("
> 	")
> 	> Response.Write ("
>
> 	MailBox created for:  " &
> 	> strEmailName & "
>
> 	")
> 	> %>
> 	>
> 	>
> 	>
> 	> Type error generate is:
> 	> (0x80040E21)
> 	> /affichedonne/creer.asp, line 48
> 	>
> 	> and
> 	> Type d'erreur :
> 	> (0x80072030)
> 	> /affichedonne/creer.asp, line 59
> 	>
> 	>
> 	>
> 	>
> 	> please help me,
> 	> thanks
>
>
>
>
>   _____
>
> Yahoo! Mail <http://fr.mail.yahoo.com>  -- Une adresse @yahoo.fr 
gratuite
> et en fran=E7ais !
> --- Change your mail options at http://p2p.wrox.com/manager.asp or to
> unsubscribe send a blank email to 
Message #3 by =?iso-8859-1?q?mohamed=20bouraoui?= <mohbouraoui@y...> on Tue, 18 Jun 2002 13:44:02 +0200 (CEST)
--0-1003710713-1024400642=:978
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit


 Thank you for helping me, , one too questions:), how to delete a mail box using CDOEX or ADSI?
and Thank for all response!
  Siegfried Weber <sweber@c...> a écrit : If DataSource.SaveTo fails the most common problem is indeed a permission
issue. The point with CDOEXM is that you, like with ADSI, cannot pass security credentials into the SaveTo call. That means your
application must run with a user account which has permissions to create the user.

Another issue you might face is a change in Exchange 2000 SP2 which requires some code changes as described here:

PRB: "80040E94" or "80040E09" Err Msg w/IDataSource.Save Method: 
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q321039



> -----Original Message-----
> From: mohamed bouraoui [mailto:mohbouraoui@y...]
> Sent: Monday, June 03, 2002 10:07 AM
> To: ASP CDO
> Subject: [asp_cdo] probleme to create a mail box with exchange 2000 using
> script
> 
> 
> 
> hi,
> 
> Thank you for the reponse, And I only wanted to say to you has what
> corresponds this error: 0x80040E21 in line 48 (objPerson.DataSource.SaveTo
> "LDAP://" & strServerName & "/CN=" & strEmailName & ",CN=users," &
> strDomainDN & " " )?
> 
> If it is the problem of the security then where I give the administrator
> username and the password ?
> 
> Thank you a the next time!!
> 
> Siegfried Weber a écrit :
> 
> I've been looking twice but couldn't locate the lines 48 & 60 hence
> I am
> note sure where the error happens. So far looking over the code I
> cannot
> see any obvious errors.
> 
> Since it appears that you are running this on a French Windows &
> Exchange machine you might want to check if the names for the
> administrative group are not different.
> 
> 
> 
> > -----Original Message-----
> > From: mohbouraoui@y... [mailto:mohbouraoui@y...]
> > Sent: Monday, May 27, 2002 7:11 PM
> > To: ASP CDO
> > Subject: [asp_cdo] probleme to create a mail box with exchange
> 2000
> using
> > script
> >
> > i'm trying to create new mailbox in exchange 2000. i can create a
> user
> in
> > the active directory using CDOEX, but i can't create mailbox and
> generate
> > me errors in line 48 and 60 (i use asp for creating new email) :
> > the is the script when i use :
> >
> > 
> >
> > > 	> Dim strServerName ' the server name, for
> 	> example "MyServer6"
> 	> Dim strDomainName ' the server's domain, for
> 	> example "MYDOMAIN3.microsoft.com"
> 	> Dim strExchangeOrg ' the Exchange organization
> 	> housing the mailbox store. For example "First Organization"
> 	> Dim strAdminGroup ' the Exchange administrative
> 	> group name, for example "First Administrative Group"
> 	> Dim strStorageGroup ' the storage group for the
> 	> mailbox store, for example "First Storage Group"
> 	> Dim strStoreName ' the mailbox store name, for
> 	> example "Mailbox Store (SERVERNAME)"
> 	> Dim strEmailName ' emailname - the user's
> 	email
> 	> name, for example "jamessmith"
> 	> Dim strFirstName ' the user's first name, for
> 	> example "James"
> 	> Dim strLastName ' the user's last name, for
> 	> example "Smith"
> 	> Dim objPerson ' object to hold CDO person
> 	object
> 	> Dim objMailbox ' object to hold IMailboxStore
> 	> interface to person object
> 	> Dim objLDAP ' object to hold LDAP
> 	> domain name reponse
> 	> Dim aryTokens
> 	> Dim strPSURL
> 	> Dim strDomainDN
> 	>
> 	> Set objPerson = CreateObject("CDO.Person")
> 	> strServerName = "MAILVOICE"
> 	>
> 	> 'LAB: get the domain name for the current user ("administrator"
> for
> 	this
> 	> lab)
> 	> Set objLDAP = GetObject("LDAP://rootdse")
> 	> strDomainName = objLDAP.Get("dnshostname")
> 	> strDomainName = Mid(strDomainName, InStr(strDomainName, ".") +
> 	1)
> 	>
> 	> strExchangeOrg = "organisation"
> 	> ' change value to run on other exchange servers
> 	> strAdminGroup = "First Administrative Group"
> 	> strStorageGroup = "First Storage Group"
> 	> strStoreName = "Mailbox Store (" & strServerName & ")"
> 	> strEmailName = "mohlil"
> 	> strFirstName = "mohlil"
> 	> strLastName = "mohlil"
> 	>
> 	> aryTokens = Split(strDomainName, ".", -1, 1)
> 	> strDomainDN = Join(aryTokens, ",dc=")
> 	> strDomainDN = "dc=" & strDomainDN & " "
> 	>
> 	> 'LAB: Create the user in Active Directory
> 	> objPerson.firstName = firstName
> 	> objPerson.lastName = lastName
> 	> objPerson.Fields("userPrincipalName") = lastName
> 	> objPerson.Fields("userAccountControl") = 512
> 	> objPerson.Fields("userPassword") = "password"
> 	> objPerson.Fields.Update
> 	> 'objPerson.DataSource.SaveTo "LDAP://" & strServerName & "/CN="
> 	<br>> 	> strEmailName & ",CN=users," & strDomainDN & " "
> 	>
> 	>
> 	>
> 	> Response.Write ("
> 
> 	")
> 	> Response.Write "LDAP://" & strServerName & "/CN=" & strEmailName
> 	> & ",CN=users," & strDomainDN
> 	> Response.Write ("
> 
> 	")
> 	>
> 	> 'LAB: create mailbox in specified location.
> 	> strPSURL = "LDAP://" & strServerName & "/CN=" & strStoreName
> 	> & ",CN=" & strStorageGroup & ",CN=InformationStore,CN=" <br>> 	strServerName
> 	> & ",CN=Servers,CN=" & strAdminGroup & "," & "CN=Administrative
> 	Groups,CN="
> 	> + strExchangeOrg & "," & "CN=Microsoft Exchange,CN=Services,"
> 	> & "CN=Configuration," & strDomainDN
> 	> Set objMailbox = objPerson.GetInterface("IMailboxStore")
> 	> objMailbox.CreateMailbox strPSURL
> 	> objPerson.DataSource.Save
> 	>
> 	> Response.Write ("
> 	")
> 	> Response.Write ("
> 
> 	MailBox created for:  " <br>> 	> strEmailName & "
> 
> 	")
> 	> %>
> >
> >
> >
> > Type error generate is:
> > (0x80040E21)
> > /affichedonne/creer.asp, line 48
> >
> > and
> > Type d'erreur :
> > (0x80072030)
> > /affichedonne/creer.asp, line 59
> >
> >
> >
> >
> > please help me,
> > thanks
> 
> 
> 
> 
> _____
> 
> Yahoo! Mail -- Une adresse @yahoo.fr gratuite
> et en français !
> --- Change your mail options at http://p2p.wrox.com/manager.asp or to
> unsubscribe send a blank email to 



---------------------------------
Yahoo! Mail -- Une adresse @yahoo.fr gratuite et en français !

Message #4 by "Siegfried Weber" <sweber@c...> on Tue, 18 Jun 2002 18:42:35 +0200
Simply use the CDOEXM DeleteMailbox like this (VBScript code):

Set objUser =3D GetObject("LDAP://....")
Set objMailboxStore =3D objUser
objMailboxStore.DeleteMailbox

<Cheers:Siegfried runat=3D"server" />

> -----Original Message-----
> From: mohamed bouraoui [mailto:mohbouraoui@y...]
> Sent: Tuesday, June 18, 2002 1:44 PM
> To: ASP CDO
> Subject: [asp_cdo] RE: probleme to create a mail box with exchange 
2000
> using script
>
>  Thank you for helping me, , one too questions:), how to delete a mail 
box
> using CDOEX or ADSI?
>
> and Thank for all response!
>
>   Siegfried Weber <sweber@c...> a =E9crit :
>
> 	If DataSource.SaveTo fails the most common problem is indeed a
> permission issue. The point with CDOEXM is that you, like with ADSI,
> cannot pass security credentials into the SaveTo call. That means your
> application must run with a user account which has permissions to 
create
> the user.
>
> 	Another issue you might face is a change in Exchange 2000 SP2 which
> requires some code changes as described here:
>
> 	PRB: "80040E94" or "80040E09" Err Msg w/IDataSource.Save Method:
> 	http://support.microsoft.com/default.aspx?scid=3Dkb;EN-US;q321039
>
>
>
> 	> -----Original Message-----
> 	> From: mohamed bouraoui [mailto:mohbouraoui@y...]
> 	> Sent: Monday, June 03, 2002 10:07 AM
> 	> To: ASP CDO
> 	> Subject: [asp_cdo] probleme to create a mail box with exchange
> 2000 using
> 	> script
> 	>
> 	>
> 	>
> 	> hi,
> 	>
> 	> Thank you for the reponse, And I only wanted to say to you has
> what
> 	> corresponds this error: 0x80040E21 in line 48
> (objPerson.DataSource.SaveTo
> 	> "LDAP://" & strServerName & "/CN=3D" & strEmailName & 
",CN=3Dusers," &
> 	> strDomainDN & " " )?
> 	>
> 	> If it is the problem of the security then where I give the
> administrator
> 	> username and the password ?
> 	>
> 	> Thank you a the next time!!
> 	>
> 	> Siegfried Weber a =E9crit :
> 	>
> 	> I've been looking twice but couldn't locate the lines 48 & 60
> hence
> 	> I am
> 	> note sure where the error happens. So far looking over the code I
> 	> cannot
> 	> see any obvious errors.
> 	>
> 	> Since it appears that you are running this on a French Windows &
> 	> Exchange machine you might want to check if the names for the
> 	> administrative group are not different.
> 	>
> 	>
> 	>
> 	> > -----Original Message-----
> 	> > From: mohbouraoui@y... [mailto:mohbouraoui@y...]
> 	> > Sent: Monday, May 27, 2002 7:11 PM
> 	> > To: ASP CDO
> 	> > Subject: [asp_cdo] probleme to create a mail box with exchange
> 	> 2000
> 	> using
> 	> > script
> 	> >
> 	> > i'm trying to create new mailbox in exchange 2000. i can create
> a
> 	> user
> 	> in
> 	> > the active directory using CDOEX, but i can't create mailbox and
> 	> generate
> 	> > me errors in line 48 and 60 (i use asp for creating new email) :
> 	> > the is the script when i use :
> 	> >
> 	> > <%@ Language=3DVBScript %>
> 	> >
> 	> > <%
> 	> > Dim strServerName ' the server name, for
> 	> > example "MyServer6"
> 	> > Dim strDomainName ' the server's domain, for
> 	> > example "MYDOMAIN3.microsoft.com"
> 	> > Dim strExchangeOrg ' the Exchange organization
> 	> > housing the mailbox store. For example "First Organization"
> 	> > Dim strAdminGroup ' the Exchange administrative
> 	> > group name, for example "First Administrative Group"
> 	> > Dim strStorageGroup ' the storage group for the
> 	> > mailbox store, for example "First Storage Group"
> 	> > Dim strStoreName ' the mailbox store name, for
> 	> > example "Mailbox Store (SERVERNAME)"
> 	> > Dim strEmailName ' emailname - the user's
> 	> email
> 	> > name, for example "jamessmith"
> 	> > Dim strFirstName ' the user's first name, for
> 	> > example "James"
> 	> > Dim strLastName ' the user's last name, for
> 	> > example "Smith"
> 	> > Dim objPerson ' object to hold CDO person
> 	> object
> 	> > Dim objMailbox ' object to hold IMailboxStore
> 	> > interface to person object
> 	> > Dim objLDAP ' object to hold LDAP
> 	> > domain name reponse
> 	> > Dim aryTokens
> 	> > Dim strPSURL
> 	> > Dim strDomainDN
> 	> >
> 	> > Set objPerson =3D CreateObject("CDO.Person")
> 	> > strServerName =3D "MAILVOICE"
> 	> >
> 	> > 'LAB: get the domain name for the current user ("administrator"
> 	> for
> 	> this
> 	> > lab)
> 	> > Set objLDAP =3D GetObject("LDAP://rootdse")
> 	> > strDomainName =3D objLDAP.Get("dnshostname")
> 	> > strDomainName =3D Mid(strDomainName, InStr(strDomainName, ".") +
> 	> 1)
> 	> >
> 	> > strExchangeOrg =3D "organisation"
> 	> > ' change value to run on other exchange servers
> 	> > strAdminGroup =3D "First Administrative Group"
> 	> > strStorageGroup =3D "First Storage Group"
> 	> > strStoreName =3D "Mailbox Store (" & strServerName & ")"
> 	> > strEmailName =3D "mohlil"
> 	> > strFirstName =3D "mohlil"
> 	> > strLastName =3D "mohlil"
> 	> >
> 	> > aryTokens =3D Split(strDomainName, ".", -1, 1)
> 	> > strDomainDN =3D Join(aryTokens, ",dc=3D")
> 	> > strDomainDN =3D "dc=3D" & strDomainDN & " "
> 	> >
> 	> > 'LAB: Create the user in Active Directory
> 	> > objPerson.firstName =3D firstName
> 	> > objPerson.lastName =3D lastName
> 	> > objPerson.Fields("userPrincipalName") =3D lastName
> 	> > objPerson.Fields("userAccountControl") =3D 512
> 	> > objPerson.Fields("userPassword") =3D "password"
> 	> > objPerson.Fields.Update
> 	> > 'objPerson.DataSource.SaveTo "LDAP://" & strServerName & "/CN=3D"
> 	> &
> 	> > strEmailName & ",CN=3Dusers," & strDomainDN & " "
> 	> >
> 	> >
> 	> >
> 	> > Response.Write ("
> 	>
> 	> ")
> 	> > Response.Write "LDAP://" & strServerName & "/CN=3D" & 
strEmailName
> 	> > & ",CN=3Dusers," & strDomainDN
> 	> > Response.Write ("
> 	>
> 	> ")
> 	> >
> 	> > 'LAB: create mailbox in specified location.
> 	> > strPSURL =3D "LDAP://" & strServerName & "/CN=3D" & strStoreName
> 	> > & ",CN=3D" & strStorageGroup & ",CN=3DInformationStore,CN=3D" &
> 	> strServerName
> 	> > & ",CN=3DServers,CN=3D" & strAdminGroup & "," & 
"CN=3DAdministrative
> 	> Groups,CN=3D"
> 	> > + strExchangeOrg & "," & "CN=3DMicrosoft Exchange,CN=3DServices,"
> 	> > & "CN=3DConfiguration," & strDomainDN
> 	> > Set objMailbox =3D objPerson.GetInterface("IMailboxStore")
> 	> > objMailbox.CreateMailbox strPSURL
> 	> > objPerson.DataSource.Save
> 	> >
> 	> > Response.Write ("
> 	> ")
> 	> > Response.Write ("
> 	>
> 	> MailBox created for: " &
> 	> > strEmailName & "
> 	>
> 	> ")
> 	> > %>
> 	> >
> 	> >
> 	> >
> 	> > Type error generate is:
> 	> > (0x80040E21)
> 	> > /affichedonne/creer.asp, line 48
> 	> >
> 	> > and
> 	> > Type d'erreur :
> 	> > (0x80072030)
> 	> > /affichedonne/creer.asp, line 59
> 	> >
> 	> >
> 	> >
> 	> >
> 	> > please help me,
> 	> > thanks
> 	>
> 	>
> 	>
> 	>
> 	> _____
> 	>
> 	> Yahoo! Mail -- Une adresse @yahoo.fr gratuite
> 	> et en fran=E7ais !
> 	> --- 
> to
> 	> unsubscribe send a blank email to 
>
>
>
>
>   _____
>
> Yahoo! Mail <http://fr.mail.yahoo.com>  -- Une adresse @yahoo.fr 
gratuite
> et en fran=E7ais !
> --- Change your mail options at http://p2p.wrox.com/manager.asp or to
> unsubscribe send a blank email to 

  Return to Index