Question

Locked

Mailbox

By Wizard-09 ·
Hello All,

I am getting the below error or what ever you want to call it on my SBS server, now I have AD running on this sbs but i am getting the below error message i have created 2 users to test sbs exchange users create ok but will not create mailbox on the system manager i think it may be down to the below not being able to find the odjects any help of way the mailbox is not being created would be great.

CN=Configuration,DC=vicisbs,DC=local' returned 0 objects.

This conversation is currently closed to new comments.

8 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

This may be easier

by Jacky Howe In reply to Mailbox

I normally use Guy Thomas's scripts as they are easy to understand and as long as the users have an account in Active Directory they will get a Mailbox. Modify the below text to suit.

------------------------------
<pre>
AddMailbox.vbs
' VBScript to add mailboxes to existing users
' Author Guy Thomas http://computerperformance.co.uk/
' Version 2.6 - April 8th 2005
Option Explicit
Dim ADOcon ' ADODB.ADOconnection
Dim command ' ADODB.Command
Dim rs ' ADODB.Recordset
Dim objPerson ' CDO.Person
Dim mbox ' CDOEXM.IMailboxStore interface
Dim iMsg ' CDO.Message
Dim intMailbox ' Increment the number of mailboxes created

strServer = "fs2003" ' Name of the File Server
strExchangeOrg = "MINERO" ' Domain Name
strDomain = "DC=MINERO,DC=LOCAL"
strOU = "OU=SBSUsers" ' Container for the users that will get a Mailbox
strAdminGroup = "First Administrative Group"
strStorageGroup = "First Storage Group"
strStoreName = "Mailbox Store (" & strServer & ")"

' Build LDAP string
strMailbox = strMailbox & "CN=" & strStoreName
strMailbox = strMailbox & ",CN=" & strStorageGroup
strMailbox = strMailbox & ",CN=InformationStore"
strMailbox = strMailbox & ",CN=" & strServer
strMailbox = strMailbox & ",CN=Servers"
strMailbox = strMailbox & ",CN=" & strAdminGroup
strMailbox = strMailbox & ",CN=Administrative Groups"
strMailbox = strMailbox & ",CN=" + strExchangeOrg
strMailbox = strMailbox & ",CN=Microsoft Exchange"
strMailbox = strMailbox & ",CN=Services"
strMailbox = strMailbox & ",CN=Configuration"
strMailbox = strMailbox & "," & strDomain

' Create the ADODB.ADOconnection and ADOconnect to Active Directory
Set ADOcon = CreateObject("ADODB.connection")
ADOcon.Provider = "ADsDSOObject"

' Create and configure the ADODB.Command
Set command = CreateObject("ADODB.Command")
ADOcon.Open
Set command.Activeconnection = ADOcon

' Select all properties of users from a given organizational group
command.CommandText = "SELECT * FROM 'LDAP://" & strOU & "," _
& strDomain & "' WHERE objectClass = 'user'"

' Execute the ADODB.Command and store the results in the ADODB.Recordset
Set rs = command.Execute

' Preparing the mailbox
Set objPerson = CreateObject("CDO.Person")

' Loop through the users
intMailbox = 0
While Not rs.EOF
' Open each CDO.Person using the location information specified by the ADsPath property
objPerson.DataSource.Open (rs.Fields("ADsPath").Value), , 3
' Get the IMailboxStore interface to the users mailbox
Set mbox = objPerson.GetInterface("IMailboxStore")

'Test if the mailbox already exists
If mbox.HomeMDB = "" Then
' If the mailbox does not exist, create it

mbox.CreateMailbox strMailbox
intMailbox = intMailbox + 1
' Set the Email property of the Person to the new mailbox
strEmail = objPerson.Fields("sAMAccountName").Value & "@CPEXCH.COM"
objPerson.Email = strEmail
objPerson.Fields.Update
objPerson.DataSource.Save

' Create a message to initialize the mailbox
Set iMsg = CreateObject("CDO.Message")

with iMsg
.To = strEmail
.From = "administrator@minero.local"
.Subject = "Welcome to your new mailbox!"
.TextBody = "Note your new email address: " & strEmail
.Send
End With

Set iMsg = Nothing
End If
'Move to the next record
rs.MoveNext
Wend
WScript.Echo intMailbox & " mailboxes were created."

WScript.Quit
</pre>
-------------------------------

Collapse -

Thanks

by Wizard-09 In reply to This may be easier

But i know nothing about VB scripts plus would this work on sbs thanks again.

Collapse -

It's actually the script

by Jacky Howe In reply to Thanks

that I run after I add my users on SBS 2003. So long as Exchange is installed and running it does the trick for me. Create a test account and move it to a Container, then modify and run the script. Go to a workstation and logon as that user, run Outlook and enter the necessary informatipn to test it.

This is what you will need to modify.

strServer = "fs2003" ' Name of the File Server
strExchangeOrg = "MINERO" ' Domain Name
strDomain = "DC=MINERO,DC=LOCAL"
strOU = "OU=SBSUsers" ' Container for the users that will get a Mailbox

.From = "administrator@minero.local"

Edit: just to add that I normally have a test environment setup to try out new projects I don't like to use the real McCoy for testing.

Collapse -

thanks

by Wizard-09 In reply to It's actually the script

so that's the only information that I need to change, leave the script other wise untouched

Collapse -

That's it

by Jacky Howe In reply to thanks

and I confess that I'm not a proficient scripter with VB but using Guys instructions have helped me out. He has a terrific script that will allow you to add multiple user accounts. If you want a copy let me know.

Collapse -

Do you have a recipiant policy

by Dumphrey In reply to Mailbox

for the domain in question? Or has the default been modified/messed up?

Collapse -

Yes

by Wizard-09 In reply to Do you have a recipiant p ...

I set one up on the server in question, plus its not running on the domain its running sbs so not on domain.

I did how ever come into day and there was an email account for the admin account so i am waiting to tomorrow to see if my other account goes in.

Back to Networks Forum
8 total posts (Page 1 of 1)  

Related Discussions

Related Forums