Wrox Programmer Forums
|
ASP CDO As of Oct 5, 2005, this forum is now locked. No posts have been deleted. Please use "Classic ASP Professional" at: http://p2p.wrox.com/forum.asp?FORUM_ID=56 for discussions similar to the old ASP Pro Code Clinic or one of the other many remaining ASP and ASP.NET forums here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP CDO section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 30th, 2004, 08:55 AM
Registered User
 
Join Date: Mar 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Invalid argument error - Exchange 2000

Hi I have a problem with the code stated below. The problem is that when trying to call the createMailbox function I get an 'one or more arguments are invalid' error. I really think I have tried everything but I just can't debug/correct the error. Hope someone are able to help me out here, thanks.

/Sebastian

<%
'First of all, get authenticated on this server.

dim IADsPath
Dim pwd
Dim uid
Dim flags

IADsPath = "LDAP://Morgul.test.dk/OU=internal, DC=test,DC=dk"
uid = "TEST\Administrator"
pwd = "********"
flags = 0

dim IADsNameSpace
set IADsNameSpace = GetObject("LDAP:")

Dim oIADsObject
set oIADsObject = IADsNameSpace.OpenDSObject( IADsPath, uid, pwd, flags )

If err.number = 0 Then
Response.Write("Login Was Successful: " & uid)
Else
Response.Write("Login Failed: " & uid)
Response.Write(err.number)
Response.Write(err.description)
End If

' Here I am going to create a user account

Dim userObj
set userObj = oIADsObject.Create("User", "cn=tester")
userObj.Put "samAccountName","tester"
userObj.Put "userPrincipalName", "Mr. Test"
userObj.Put "givenName", "Testperson"
userObj.Put "sn", "test"
userObj.Put "DisplayName", "[email protected]"
userObj.Put "mail", "[email protected]"

userObj.SetInfo
userObj.changePassword "", "test"
userObj.AccountDisabled = False
userObj.SetInfo

' Now to create a mailbox
Dim mailboxObj
set mailboxObj = userObj

mailboxObj.CreateMailbox "LDAP://Morgul.test.dk/CN=Mailbox Store (Morgul), CN=First Storage Group, CN=InformationStore, CN=Morgul, CN=Servers, CN=First Administrative Group, CN=Administrative Groups, CN=Morgul Online,CN=Microsoft Exchange, CN=Services, CN=Configuration, DC=test, DC=dk"

Dim contactObj
set contactObj = oIADsObject.Create("contact", "cn=testing")
contactObj.Put "givenName", "testing"
contactObj.Put "sn", "testing"
'contactObj.Email = "[email protected]"
contactObj.SetInfo

contactObj.MailEnable "smtp:[email protected]"
contactObj.SetInfo

'setting the forwarding mail
userObj.ForwardTo = "LDAP://morgul.test.dk/CN=testing, OU=internal, DC=test,DC=dk"
userObj.SetInfo

set userObj = Nothing
set contactObj = Nothing
set mailboxObj = Nothing
set IADsNameSpace = Nothing

%>





Similar Threads
Thread Thread Starter Forum Replies Last Post
Invalid argument supplied for foreach() codejockey Beginning PHP 4 September 24th, 2010 03:40 AM
Error: Invalid postback or call back argument kalyanykk ASP.NET 2.0 Basics 0 August 26th, 2008 06:03 AM
Invalid Argument ppenn Access VBA 2 May 14th, 2007 10:11 AM
Invalid postback or callback argument. kingw BOOK: Professional Ajax ISBN: 978-0-471-77778-6 1 January 1st, 2007 09:49 PM
Invalid Argument.... baNTON Access VBA 4 April 27th, 2004 06:18 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.