Automatically Turn on/off OOA based on day and time

We are running an Exchange 2007 environment on Windows 2003 Server and our workstations are running Outlook 2007 on Windows XP SP2. Both Exchange and Outlook are running the latest service packs. We have a call center environment in our company which answers emails during a specific period of time during the day from a single shared mailbox, from 8am to 6pm Monday through Friday. I know that you have the ability to configure your OOA to start at a specific date and time and also stop it at a specific date and time. I wanted to see if there was a way to automatically configure the Out of Office Assistance to turn itself on at the end of our shift and then automatically turn itself off at the beginning of the shift. Since it is a shared mailbox, what we have to do now to make that happen is log into that shared mailbox through Outlook and turn on the OOA at the end of our shift and then do the same when we have to turn off the OOA at the beginning of our shift. We would obviously prefer a free solution if there is one available. Our research so far has turned up some VB scripts but they have to run on the client side and for us since it's a shared mailbox, we just add it as an additional mailbox in our Outlook profile so we can see our personal mailbox along with the other shared one. THis solution would have to run on the server side or be something that we can enable without loging into this shared mailbox every time to configure the OOA.

Any suggestions would be greatly appreciated.
Who is Participating?
David LeeCommented:
Got it.  Don't know what else to suggest.  The code depends on CDO 1.21.  I can do it client-side in Outlook 2007, but you'd indicated that you aren't looking for a client-side solution.  The only other means I know of is to use a 3rd-party solution which isn't free.
David LeeCommented:
Hi, OWN3D.

I'm not sure this will work and am not in a position to test it.  You can try it and see what happens.  The worst that'll happen is it won't work.

1.  Open Notepad
2.  Copy the code and paste it into Notepad
3.  Edit the code per the comments I placed in it
4.  Save the file with a .vbs extension

Double-click the file to run it.  If it works, then we can talk about how to set it up to run automatically.

This code uses Collaboration Data Objects (CDO).  If they aren't installed on the server, and I don't know if Exchange 2007 comes with them, then this will not work.  CDO does not come with Outlook 2007, but might be on your computer if you upgraded from an earlier version of Outlook.  The computer you run this from must have a mail profile defined for the shared mailbox.  That profile name has to be entered on line 4 of the code per the comment.

Dim objMAPISession
Set objMAPISession = CreateObject("MAPI.Session")
'Replace Outlook with the name of your profile.  Replace Password with the password for that profile.'
objMAPISession.Logon "Outlook", "Password", False, True
objMAPISession.OutOfOffice = True
Set objMAPISession = Nothing

Open in new window

OWN3DAuthor Commented:
Thanks for the information BlueDevilFan. I ran the VB script on a WinXP workstation running Outlook 2007 with the shared mailbox profile setup and it failed with the error message "ActiveX component can't create object: 'Mapi.Session'. Code: 800A01AD. Source Microsoft VBScript runtime error. <<See attached: VBScript-Error-042409.png>. This was expected since it does not come with Outlook 2007 or XP natively. I then tried to install the CDO libraries following this MS article: and got an installation error saying  "Collaboration Data Objects 1.2.1 cannot be installed with Microsoft Exchange." <<See attached: CDOInstall-Error-042409.png>.
Unfortunately I don't know where to date this possible solution from here. I also cannot make any changes in our exchange environment for this to work so any changes would have to be made on the client side.
Any help is appreciated.

David LeeCommented:
I'm a little confused.  You tried the script on a workstation running XP and it failed because CDO wasn't installed.  You then "tried to install the CDO libraries" and got the error "Collaboration Data Objects 1.2.1 cannot be installed with Microsoft Exchange".  How did you get from trying the script in a workstation to attempting to install CDO on the Exchange server?  How about installing CDO on the workstation?  
OWN3DAuthor Commented:
I understand how that error message is misleading because it says it "cannot be installed with MS Exchange". I didn't try installing anything on the server. I will not be making any changes on our Exchange servers unless it's adding a server side rule of some kind.  I tried installing the CDO libraries on the XP workstation running Outlook 2007 and received that error message.
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.