[Last Call] Learn how to a build a cloud-first strategyRegister Now


Using a Public Folder as a Mailbox

Posted on 2007-12-06
Medium Priority
Last Modified: 2008-02-01
Hi im new to SBS and need your help please, This question follows on from a link given on an existing post, http://www.msexchange.org/articles/MF021.html
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/yourdomain.com/public folders/yourfolder/ChangeMessageClass" -file C:\ChangeMessageClass.vbs WHERE "DAV:ishidden" = False  
Question by:47lamy
  • 4
  • 3
  • 2

Accepted Solution

deadite earned 1050 total points
ID: 20426625
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/yourdomain.com/public 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.

Author Comment

ID: 20428017
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 http://www.experts-exchange.com/Software/Server_Software/Email_Servers/Exchange/Q_20753850.html
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

Expert Comment

ID: 20428931
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?
Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.


Author Comment

ID: 20440830
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?

Author Comment

ID: 20446371
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?


Author Comment

ID: 20688751
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.  

Expert Comment

ID: 23623432
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.

Expert Comment

ID: 23684287
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:

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: http://support.microsoft.com/kb/249199

Expert Comment

ID: 23684323
B.T.W.  Above instructions should say open a 'new blank email' rather than a Word Document...!  

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Mailbox Corruption is a nightmare every Exchange DBA wishes he never has. Recovering from it can be super-hectic if not entirely futile. And though techniques like the New-MailboxRepairRequest cmdlet have been designed to help with fixing minor corr…
This article will help to fix the below errors for MS Exchange Server 2016 I. Certificate error "name on the security certificate is invalid or does not match the name of the site" II. Out of Office not working III. Make Internal URLs and Externa…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question