Solved

Out of Office assistant script

Posted on 2007-04-04
2
1,508 Views
Last Modified: 2008-09-30
I would like to set-up a script that turn the Out of Office assistant for someone,s else mailbox. The reason is some supervisor, when their employee don't come in, they often forget about setting their Out of Office and keep asking me to do it, so if I give them a small script it would ease the process.

0
Comment
Question by:MPAQUIN
2 Comments
 
LVL 3

Accepted Solution

by:
eshurak earned 250 total points
ID: 18853017
The Out of Office assistant is not available in VBA and if it was you would have some permissions issues  to deal with.

You can use CDO:

http://www.outlookcode.com/d/cdo.htm

http://groups.google.com/group/microsoft.public.outlook.program_vba/browse_thread/thread/398688f255d9cad0/e44b405864caaf34?lnk=st&q=out+of+office+vb&rnum=1&hl=en#e44b405864caaf34

Good luck
0
 

Expert Comment

by:Chromarty
ID: 22607462
Here is a VB script that uses CDO to manipulate OOF.  Works on a server with Exchange management tools installed and run as an account with full control over the target mailbox.

Dim mapiSession
Dim sMailbox
Dim sServer

strMailbox = "Username"
strServer = "ExServer"

Set mapiSession = CreateObject("MAPI.Session") mapiSession.Logon , , True, True, , , strServer & vbLf & strMailbox

If Err.Number = 0 Then
Wscript.Echo "Logged in!"
mapiSession.OutOfOffice = True
mapiSession.OutOfOfficeText = "I am out of Office."
Wscript.Echo  "OOF set!"
End If

mapiSession.Logoff
Set mapiSession = Nothing

Wscript.Echo "Logged off!"
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this video we show how to create a mailbox database in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Servers >> Data…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

685 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