|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Get Out-of-Office FlagIn 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 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 > > > > > 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 > > > > > > Great script.
Any chance of getting date and time the out-of-office was activated? url:http://www.ureader.com/msg/1173825.aspx
Other interesting topics
Webdav htmldescription field
Permissions on DavMailSubmissionURI 409 Conflict when sending mail using WebDAV memory allocation (malloc vs CoTaskMemAlloc) How to download attachements from Exchange server 2003 Connect Exchange to developed security system event sink for filtering incoming mails to public folders Redistribute CDO 1.21 to Test Environment Exchange 2003 and VS 2003 .NET Event Sink to copy messages |
|||||||||||||||||||||||