Using a Public Folder as a Mailbox

Hi im new to SBS and need your help please, This question follows on from a link given on an existing post,
Thanks for the link given above using pupic folder as mailbox, exaclty what i need.
Firstup the batch file wont extract, which would have been too easy, i have read and completed the first part of instructions on this batch file, but now im confused when it comes to registering the script event sink handler, and save event. Can anyone help explain the last couple of instructions on this .bat in laymans terms please, below is the complete batch file instructions.
:Do the following steps to register the event sink in COM+
:: This is required to have it running in the proper security context
:: - Start the Component Services MMC
:: - Select Component Services > Computer > My Computer > COM+ Applications
:: - Right mouse click and select > New > Application
:: - Create an empty Server application
:: - Enter a name of your choice. E.g. ScriptSink
:: - Select a valid user who has owner permissions on the folder in question
:: - Change to your newly created application
:: - Expand the subfolders and right-click on the Components folder
:: - Select > New > Component
:: - Select C:\Program Files\Exchsrvr\Bin\EXODBESH.DLL
:: - Select My Computer > Refresh All Components (or even better restart the machine)

:: Use the following code to register the ExOledb script event sink handler COM+ program
:: Change to C:\Program Files\Exchsrvr\Bin before running the below lines
:: Note that these steps are only necessary once and if you never did them before
rem regsvr32.exe exodbesh.dll
rem regsvr32.exe exodbprx.dll

:: Register the VBScript as asynchronous save event
cscript RegEvent.vbs Add "OnSave" ExOleDB.ScriptEventSink.1 "file://./backofficestorage/ folders/yourfolder/ChangeMessageClass" -file C:\ChangeMessageClass.vbs WHERE "DAV:ishidden" = False  
Who is Participating?
deaditeConnect With a Mentor Commented:
Registering the event sink:
1) Open a command prompt (Start > Run >CMD)
2) Change directories to the Exchange bin folder with the following commands:
    cd c:\Program Files\Exchsrvr\bin
   ***Note: if your exchange is in a different directory, you need to just change the above to match it
3) Register them with the following commands:
   regsvr32.exe exodbesh.dll
   regsvr32.exe exodbprx.dll

Register the vbscript as asynchronouse save event:
1) Open a command prompt (Start > Run > CMD)
2) Change directory to the location of the file called "RegEvent.vbs"
3) Now type the following command:
cscript RegEvent.vbs Add "OnSave" ExOleDB.ScriptEventSink.1 "file://./backofficestorage/ folders/yourfolder/ChangeMessageClass" -file C:\ChangeMessageClass.vbs WHERE "DAV:ishidden" = False  

That command simply uses cscript to launch the VBScript file...  The rest of the stuff after RegEvent.vbs are just parameters being passed to that script.
47lamyAuthor Commented:
Thanks deadite, this makes good sense now. Unfortunately i ran an error in the process, registering event sink worked fine, its when i type the long save event command. I have double checked for type errors including inserting my domain and the new folder i created in public folders into the command.
Error Is; Error Opening Connection: -2146105340

I have found a link to another user with the same topic and problem
I have tried the way this user describes which is editing the batch file saving to the folder and executing, but it runs the same error as above.
Do you have any suggestions what could i be doing wrong. Thanks Again
Are you running it locally on the Exchange server?  And are you an admin on that machine?

Also, do you have a file named "ChangeMessageClass.vbs" in the root of your C: drive?
Easily manage email signatures in Office 365

Managing email signatures in Office 365 can be a challenging task if you don't have the right tool. CodeTwo Email Signatures for Office 365 will help you implement a unified email signature look, no matter what email client is used by users. Test it for free!

47lamyAuthor Commented:
Logged In Locally as Admin, have two vbs files in the root
ChangeMessageClass.vbs also ChangeMsgClass.vbs

The new puplic folder i created is called /Info Customers and Support/ Is there possibitly this has been shortened or too long for the command string?
47lamyAuthor Commented:
Could there be a problem with the vbs syntax as original script programmed for 2000 not SBS?
Would it help if i posted any snippets of code to assist?

47lamyAuthor Commented:
I couldn't work this script out. I worked round it by changing a registry key in SBS. In the end, for me sharing a mailbox for a helpdesk worked better than using a public folder.  
Same problem - same error code.  Everything seems to be correct as described above.  Have done this before without any trouble so don't know what's wrong this time.  Could it have been broken by an Exchange Service Pack?  I know this was originally designed to be effective on Exchange 2000 and not 2003.
Ok - I'm having a good day today and I've found a way to get around this problem using a Microsoft Technet procedure.

Basically, what you do is create a new blank email message (i.e. as if you were sending an email) and you use that template to create a new form.  Then you set that new form as the default form for the public folder where you want the posts to be emails.

I had to use Microsoft Outlook XP as I found the menus didn't exist in Outlook 2007 - I'm sure it's possible to do this with Outlook 2007 but all the instructions explain how to do it with Outlook XP so I thought it would be easier to use the older version.

Here is the relevant clip from the Microsoft article.

To Set a Non-Standard Form as the Default Form in a Folder

You can use the following example as a basis for setting a non-standard form as the default form for a folder. In this example, an Office document form that is based on Word is set as the default form for a public folder.
 Back to the top

How to Create and Publish the Form

Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact a Microsoft Certified Partner or the Microsoft fee-based consulting line at (800) 936-5200. For more information about Microsoft Certified Partners, please visit the following Microsoft Web site:
For more information about the support options that are available and about how to contact Microsoft, visit the following Microsoft Web site:;EN-US;CNTACTMS;en-us;cntactms

To create, and then publish a form:
1.      Open the public folder you want to set a default form for.
2.      Open a Word Office form. To do this, on the File menu, point to New, and then click Office Document. Double-click the Microsoft Word Document icon. When prompted to either send or post the document, click Post the document in this folder, and then click OK.
3.      Publish the Word Office form to the public folder. To do this, on the Tools menu, point to Form, and then click Publish Form As. Set Look in to the name of the public folder. Type WordDoc as the Display name for the form, and then click Publish. When prompted to send the form definition with the item, click No.
4.      On the File menu, click Close. When prompted to save changes, click No, so a new item is not created.
 Back to the top

How to Create and Publish the "Intermediate" Form

1.      On the File menu, point to New, and then click Post in This Folder.
2.      On the Tools menu, point to Forms, and then click Design This Form.
3.      On the Form menu, click View Code. This opens the Script Editor.
4.      Enter the following code in the Script Editor.

Function Item_Open()

   Dim InboxItems
   Dim NewItem

   ' Reference the items in the folder.
   Set colItems = Application.ActiveExplorer.CurrentFolder.Items

   ' Add a new item to the folder, in this cased based on the
   ' published "WordDoc" Word Office Form.
   Set oNewItem = colItems.Add("IPM.Message")

  ' Display the item just created.

   ' Cancel the open event so the post form is not displayed.
   Item_Open = False

   ' Clean up
   Set colItems = Nothing
   Set oNewItem = Nothing

End Function
5.      In the Script Editor, on the File menu, click Close.
6.      In the form, on the Tools menu, point to Forms, and then click Publish Form As.
7.      Confirm that Look in is set to Outlook Folders, and that the public folder is selected.
8.      In the Display name box, type a name for the form, and then click Publish.
9.      On the File menu, click Close. When prompted to save changes, click No so that a new item is not created.
 Back to the top

How to Set the Default Form for the Folder

1.      Right-click the public folder and click Properties.
2.      Change the When posting to this folder, use setting to the name of the post form that was just published.
3.      Click OK.

To test the form, click the first button on the toolbar to start the new form. You see an Office document form that is based on Word instead of the standard form for the folder.

This is a tweaked version of the original Microsoft article so you need to follow the instructions above if you want it to work properly.  But if you want to see the original Microsoft article then folllow this link:
B.T.W.  Above instructions should say open a 'new blank email' rather than a Word Document...!  
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.