Solved

Using a Public Folder as a Mailbox

Posted on 2007-12-06
9
851 Views
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  
0
Comment
Question by:47lamy
  • 4
  • 3
  • 2
9 Comments
 
LVL 8

Accepted Solution

by:
deadite earned 350 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.
0
 

Author Comment

by:47lamy
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
0
 
LVL 8

Expert Comment

by:deadite
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?
0
 

Author Comment

by:47lamy
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?
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 

Author Comment

by:47lamy
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?

 
0
 

Author Comment

by:47lamy
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.  
0
 
LVL 2

Expert Comment

by:-CPG-
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.
0
 
LVL 2

Expert Comment

by:-CPG-
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:
https://partner.microsoft.com/global/30000104https://partner.microsoft.com/global/30000104
For more information about the support options that are available and about how to contact Microsoft, visit the following Microsoft Web site:
http://support.microsoft.com/default.aspx?scid=fh;EN-US;CNTACTMShttp://support.microsoft.com/default.aspx?scid=fh;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.
  oNewItem.Display

   ' 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
0
 
LVL 2

Expert Comment

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

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Set OWA language and time zone in Exchange for individuals, all users or per database.
If you don't know how to downgrade, my instructions below should be helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

759 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now