Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - "unknow exception" when trying to create exchange 2003 mailbox.

Reply
 
Old 09-24-2008   #1 (permalink)
baron1211


 
 

"unknow exception" when trying to create exchange 2003 mailbox.

Hello all,

I am working on a user creation script that will create users, home
share, set permissions on share and users mailbox. The user creation,
share and permissions work great, but when it comes to creating the
mailbox I get an "Unknown Exception". Below is the section where the
error pops up. I have been staring at this for a week and can not see
my mistake. Can anyone see where I messed up?

Daryl

'Create Users Mailbox
Dim oIADSUser
Dim MStore
strDefaultNC = "DC=CI,DC=West-Linn,DC=OR,DC=US"
Set oIADSUser = GetObject("LDAP://CN=" & strusername & ",OU=City Users
& Groups,DC=CI,DC=West-Linn,DC=OR,DC=US")

If UCase(Right(Username,1)) <= Chr(76) Then
MStore = "Mailboxes A-L"
Else
MStore = "Mailboxes M-Z"
End If

oIADSUser.CreateMailbox "LDAP://CN=" & MStore & ",CN=COWL Storage
Group,CN=Mailbox Store,CN=COWL-3,CN=Servers,CN=Administrative
Groups,CN=westlinnoregon.gov,CN=Microsoft
Exchange,CN=Services,CN=Configuration,DC=CI,DC=West-Linn,DC=OR,DC=US"
oIADSUser.SetInfo

My System SpecsSystem Spec
Old 09-24-2008   #2 (permalink)
Richard Mueller [MVP]


 
 

Re: "unknow exception" when trying to create exchange 2003 mailbox.


"baron1211" <res0ew3q@xxxxxx> wrote in message
news:c43a48b2-6006-413b-a834-ff14627a3ffc@xxxxxx
Quote:

> Hello all,
>
> I am working on a user creation script that will create users, home
> share, set permissions on share and users mailbox. The user creation,
> share and permissions work great, but when it comes to creating the
> mailbox I get an "Unknown Exception". Below is the section where the
> error pops up. I have been staring at this for a week and can not see
> my mistake. Can anyone see where I messed up?
>
> Daryl
>
> 'Create Users Mailbox
> Dim oIADSUser
> Dim MStore
> strDefaultNC = "DC=CI,DC=West-Linn,DC=OR,DC=US"
> Set oIADSUser = GetObject("LDAP://CN=" & strusername & ",OU=City Users
> & Groups,DC=CI,DC=West-Linn,DC=OR,DC=US")
>
> If UCase(Right(Username,1)) <= Chr(76) Then
> MStore = "Mailboxes A-L"
> Else
> MStore = "Mailboxes M-Z"
> End If
>
> oIADSUser.CreateMailbox "LDAP://CN=" & MStore & ",CN=COWL Storage
> Group,CN=Mailbox Store,CN=COWL-3,CN=Servers,CN=Administrative
> Groups,CN=westlinnoregon.gov,CN=Microsoft
> Exchange,CN=Services,CN=Configuration,DC=CI,DC=West-Linn,DC=OR,DC=US"
> oIADSUser.SetInfo
I believe the parameter passed to the CreateMailbox method should not
include the "LDAP://" moniker. Try:

oIADSUser.CreateMailbox "CN=" & MStore _
& ",CN=COWL Storage Group,CN=Mailbox Store,CN=COWL-3," _
& "CN=Servers,CN=Administrative Groups," _
& "CN=westlinnoregon.gov,CN=Microsoft Exchange,CN=Services," _
& "CN=Configuration,DC=CI,DC=West-Linn,DC=OR,DC=US"

--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
--


My System SpecsSystem Spec
Old 09-26-2008   #3 (permalink)
baron1211


 
 

Re: "unknow exception" when trying to create exchange 2003 mailbox.

On Sep 24, 3:11*pm, "Richard Mueller [MVP]" <rlmueller-
nos...@xxxxxx> wrote:
Quote:

> "baron1211" <res0e...@xxxxxx> wrote in message
>
> news:c43a48b2-6006-413b-a834-ff14627a3ffc@xxxxxx
>
>
>
>
>
Quote:

> > Hello all,
>
Quote:

> > * I am working on a user creation script that will create users, home
> > share, set permissions on share and users mailbox. *The user creation,
> > share and permissions work great, but when it comes to creating the
> > mailbox I get an "Unknown Exception". *Below is the section where the
> > error pops up. *I have been staring at this for a week and can not see
> > my mistake. *Can anyone see where I messed up?
>
Quote:

> > Daryl
>
Quote:

> > *'Create Users Mailbox
> > Dim oIADSUser
> > Dim MStore
> > strDefaultNC = "DC=CI,DC=West-Linn,DC=OR,DC=US"
> > Set oIADSUser = GetObject("LDAP://CN=" & strusername & ",OU=City Users
> > & Groups,DC=CI,DC=West-Linn,DC=OR,DC=US")
>
Quote:

> > If UCase(Right(Username,1)) <= Chr(76) Then
> > MStore = "Mailboxes A-L"
> > Else
> > MStore = "Mailboxes M-Z"
> > End If
>
Quote:

> > oIADSUser.CreateMailbox "LDAP://CN=" & MStore & ",CN=COWL Storage
> > Group,CN=Mailbox Store,CN=COWL-3,CN=Servers,CN=Administrative
> > Groups,CN=westlinnoregon.gov,CN=Microsoft
> > Exchange,CN=Services,CN=Configuration,DC=CI,DC=West-Linn,DC=OR,DC=US"
> > oIADSUser.SetInfo
>
> I believe the parameter passed to the CreateMailbox method should not
> include the "LDAP://" moniker. Try:
>
> oIADSUser.CreateMailbox "CN=" & MStore _
> * * & ",CN=COWL Storage Group,CN=Mailbox Store,CN=COWL-3," _
> * * & "CN=Servers,CN=Administrative Groups," _
> * * & "CN=westlinnoregon.gov,CN=Microsoft Exchange,CN=Services," _
> * * & "CN=Configuration,DC=CI,DC=West-Linn,DC=OR,DC=US"
>
> --
> Richard Mueller
> MVP Directory Services
> Hilltop Lab -http://www.rlmueller.net
> --- Hide quoted text -
>
> - Show quoted text -
Richard,

Thank you for the information. I have removed the LDAP piece and am
still having an issue with the "SEt oIADSUSER" command. What I am
trying to do is get the name I enter into an input box as the user
name and have it be the "name" portion of the email address. I am
calling the "strusername" further up the script and when I debug the
script I can see the variable populated correctly, but when I try and
use it in the Set command "Set oIADSUser = GetObject("CN= " &
strusername & " ,OU=City Users & Groups,DC=CI,DC=West-
Linn,DC=OR,DC=US")", I get an "unknow exception". I hope I have done
a better job explaining what I am trying to get to.

Daryl
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Exchange 2003 Mailbox Store defaults via VBScript VB Script
Exception calling "CreateInstance" with "2" argument(s): for Microsoft.Update.UpdateColl PowerShell
Exception calling "Send" with "1" argument(s) error using PING PowerShell
Exchange new-mailbox parameter issue "ManagedFolderMailboxPolicy†PowerShell
How to create a mailbox in Exchange 2003 using Powershell PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46