Home All Groups Group Topic Archive Search About

Get Out-of-Office Flag

Author
29 Dec 2005 1:42 PM
msnews.microsoft.com
In a separate application I would like to determine if a user has set their
Out-of-Office setting on or off.  How can this be done?

Thanks.

I want to be able to pass it a network login and get back a Yes/No, On/Off,
or 1/0, etc.
I have VS.Net 2003
I can query LDAP/Active Directory (Windows Server 2003)
The script or program to obtain the Out-of-Office setting can not run on the
Exchange 2003 server
Author
3 Jan 2006 1:19 AM
Glen Scales [MVP]
The out of office status is held in the
http://schemas.microsoft.com/exchange/oof-state property in the root of a
users mailbox. To access this property you need to use a Exchange API so
MAPI,WebDAV or Exoledb. You could do it remotely using a WebDAV propfind eg
something like


set xmlobjreq = createobject("Microsoft.XMLHTTP")
xmlstr = "<?xml version='1.0' encoding='UTF-8' ?>" _
& "<a:propfind xmlns:a='DAV:'
xmlns:b='urn:schemas-microsoft-com:datatypes'>" _
& "<a:prop xmlns:d='http://schemas.microsoft.com/exchange/'>" _
& "<d:oof-state/>" _
& "</a:prop>" _
& "</a:propfind>"
xmlobjreq.open "PROPFIND", "http://server/exchange/mailbox/NON_IPM_SUBTREE",
false, "", ""
xmlobjreq.setRequestHeader "Content-Type", "text/xml; charset=""UTF-8"""
xmlobjreq.setRequestHeader "Depth", "0"
xmlobjreq.setRequestHeader "Translate", "f"
xmlobjreq.send xmlstr
set oResponseDoc = xmlobjreq.responseXML
set osubNodeList = oResponseDoc.getElementsByTagName("d:oof-state/")
ntar = osubNodeList.length -1
wscript.Echo osubNodeList.Item(ntar).text


Cheers
Glen

<msnews.microsoft.com> wrote in message
Show quoteHide quote
news:uyatm2HDGHA.3856@TK2MSFTNGP12.phx.gbl...
> In a separate application I would like to determine if a user has set
> their Out-of-Office setting on or off.  How can this be done?
>
> Thanks.
>
> I want to be able to pass it a network login and get back a Yes/No,
> On/Off, or 1/0, etc.
> I have VS.Net 2003
> I can query LDAP/Active Directory (Windows Server 2003)
> The script or program to obtain the Out-of-Office setting can not run on
> the Exchange 2003 server
>
>
>
>
>
Are all your drivers up to date? click for free checkup

Author
3 Jan 2006 2:03 AM
Scott Thomas
You could use a VBS script or convert it into a HTML application.

You need to have deligation rights for the user you run this as. Simple, but
does the job.

Using Code:

strServer = InputBox("Exchange Server","Exchange Server Name","default")
strUser = InputBox("User Name","Exchange User ID","default")

set mapiSession = CreateObject("MAPI.Session")
mapiSession.Logon , , showDialog, true, , , strServer & vblf & strUser

wscript.Echo "oof: " & mapiSession.OutOfOffice
wscript.Echo "oof msg: " & mapiSession.OutOfOfficeText

mapiSession.Logoff


Show quoteHide quote
"msnews.microsoft.com" wrote:

> In a separate application I would like to determine if a user has set their
> Out-of-Office setting on or off.  How can this be done?
>
> Thanks.
>
> I want to be able to pass it a network login and get back a Yes/No, On/Off,
> or 1/0, etc.
> I have VS.Net 2003
> I can query LDAP/Active Directory (Windows Server 2003)
> The script or program to obtain the Out-of-Office setting can not run on the
> Exchange 2003 server
>
>
>
>
>
>
Author
29 Apr 2009 7:48 AM
Vlastimil Schart
Great script.
Any chance of getting date and time the out-of-office was activated?

url:http://www.ureader.com/msg/1173825.aspx

Bookmark and Share