获取未读邮件计数Exchange 2003 [英] Getting unread message count Exchange 2003

查看:79
本文介绍了获取未读邮件计数Exchange 2003的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我需要获取特定OU中所有用户的未读消息计数(并排除Contact对象)。我在互联网上找到了一些代码,但这似乎不起作用,它只是在第17行之后没有错误或任何类型的输出结束。 


 


  Set  sysinfo = CreateObject(" ADSystemInfo" 
Set oUser = GetObject(" LDAP://" & sysinfo.UserName& ""
strhomeserver = oUser.msExchHomeServerName
strhomeserver = Right(strhomeserver,Len(strhomeserver) - (InStr(strhomeserver," cn = Servers / cn =" )+ 13))
strRootURI = " http://" & strhomeserver& " / exchange /" & oUser.mail& " / inbox /"

set xmlobjreq = CreateObject(" MSXML2.ServerXMLHTTP"
xmlreqtxt = "<?xml version ='1.0'?>< a:propfind xmlns:a ='DAV:'xmlns:d ='urn:schemas:httpmail:'>< a:prop>< d:unreadcount />< / a:prop>< / a:propfind>"
xmlobjreq.open " PROPFIND" ,strRootURI, false "" ""
xmlobjreq.setRequestHeader " Content-Type" " text / xml; charset ="" UTF-8"""
xmlobjreq.setRequestHeader " Depth" " 0"
xmlobjreq.setRequestHeader " Translate" " f"
xmlobjreq.send xmlreqtxt

set oResponseDoc = xmlobjreq.responseXML
set oNodeList = oResponseDoc.getElementsByTagName(" d:unreadcount"

For i = 0 To (oNodeList.length -1)
set oNode = oNodeList.nextNode
wscript.echo oNodeList.Text
Next

解决方案

似乎是一个重复的论坛发帖。上述帖子有更新可用  @

http://social.technet.microsoft.com/Forums/en-ZA/ITCG/thread/ba8c9262-e4c4-4bd3-b87a-907c8e705315


I need to get the unread message count of all users in a particular OU (and exclude Contact objects). I found some code on the Internet, but that doesn't seem to work, it just ends after line 17 without error or any kind of output. 

 

Set sysinfo = CreateObject("ADSystemInfo") 
Set oUser = GetObject("LDAP://" & sysinfo.UserName & "") 
strhomeserver = oUser.msExchHomeServerName 
strhomeserver = Right(strhomeserver, Len(strhomeserver) - (InStr(strhomeserver, "cn=Servers/cn=") + 13)) 
strRootURI = "http://" & strhomeserver & "/exchange/" & oUser.mail & "/inbox/" 

set xmlobjreq = CreateObject("MSXML2.ServerXMLHTTP") 
xmlreqtxt = "<?xml version='1.0'?><a:propfind xmlns:a='DAV:'xmlns:d='urn:schemas:httpmail:'><a:prop><d:unreadcount/></a:prop></a:propfind>" 
xmlobjreq.open "PROPFIND",strRootURI, false, "", "" 
xmlobjreq.setRequestHeader "Content-Type", "text/xml; charset=""UTF-8""" 
xmlobjreq.setRequestHeader "Depth", "0" 
xmlobjreq.setRequestHeader "Translate", "f" 
xmlobjreq.send xmlreqtxt 

set oResponseDoc = xmlobjreq.responseXML 
set oNodeList = oResponseDoc.getElementsByTagName("d:unreadcount") 

For i = 0 To (oNodeList.length -1) 
set oNode = oNodeList.nextNode 
wscript.echo oNodeList.Text 
Next 

解决方案

It seems a duplicate forum posting. There was an update available for the above post @ http://social.technet.microsoft.com/Forums/en-ZA/ITCG/thread/ba8c9262-e4c4-4bd3-b87a-907c8e705315.


这篇关于获取未读邮件计数Exchange 2003的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆