所有,我试图将Exchange 2003邮箱的内容的列表导出到CSV文件。 具体来说,我试图检索用户邮箱中每个邮件的文件夹path,主题,大小,收到时间,发送时间(可选)和邮件ID(也可选)。
我在Exchange 2007及更高版本中使用Exchange Web Services API工作,但这不适用于2003。
WebDAV没有在环境中启用,我目前正在validationPOP3 / IMAP是否可用。 假设它不是,还有另一种方法来做到这一点,我失踪了?
您尚未提供有关您尝试访问的系统或邮箱的访问权限的信息。 如果您是此服务器的交换pipe理员,则可能最容易为您添加对您的邮箱的读访问权限,并使用exmerge将其复制到另一个帐户,或者如果您碰巧将Access安装为Office的一部分您可以使用Access中的“获取外部数据”从Outlook中吸取电子邮件,并且可以包含date字段。 从Access中,您可以非常简单地将表格转储到Excel(或csv)中。
可悲的是,交换Web服务API不适用于Exchange 2003或SBS。
既然这是2003年你正在谈论,你可以使用WMI或PowerShell来做你正在想的东西。
Brian Desmond在他的网站上有一个WMI脚本,可以提取这种信息。 这个脚本会将关于特定服务器或服务器组上的每个邮箱的很多有用信息转储到CSV文件中,然后您可以将其导入到Excel中并从中创build电子表格。 如果我需要做很多计算或数据挖掘,我通常会使用DTS(数据转换服务)将数据导入到SQL Server表中。 在执行真正需要大量数据索引的任务时,Excel变得非常慢。
注意:该脚本使用WMI来获取此信息,因此需要Exchange 2003。 Active Directory中只需要Exchange View Only级别权限,但是在每台Exchange服务器上可能需要本地pipe理员权限。 我没有一个Exchange 2003服务器可以随时testing,而且当他最初编写这个脚本时,他正在作为Exchange Full Admin运行。 所以请自担风险! 取自: http : //briandesmond.com/blog/script-to-dump-exchange-mailbox-info-to-spreadsheet-csv/
'========================================================================== ' NAME : Exchange Mailbox Stats Dumper ' AUTHOR : Brian Desmond, [email protected] ' DATE : 12/28/2005 ' COMMENT: This script requires Exchange 2003. It will dump information ' about each mailbox on the mailbox servers specified ' ' Version Date Author Note ' ----------------------------------------------------------------- ' 1.0 28Nov05 Brian Desmond Initial Version ' 1.1 03Sep06 Brian Desmond ' 1.2 13Dec08 Brian Desmond Fixed array sizing bug, ' Added error handling note ' Added TODOs ' Moved configurable items up '========================================================================== Option Explicit ' Note this script currently uses On Error Resume Next ' this isn't best practice - in reality this should be tightly ' wrapped around the WMI connection logic in the loop rather ' than up here. On Error Resume Next ' TODO: Configure this ' This is the total number of servers which you ' will specify for inventory Const TOTAL_SERVERS = 3 Dim strComputer() ReDim strComputer(TOTAL_SERVERS) ' TODO: Populate this array ' Enter each server name below as an entry in the array ' starting with zero strComputer(0) = "xmb01" strComputer(1) = "xmb02" strComputer(2) = "xmb03" '========================================================================== Dim objWMIService Dim colItems Dim fso Set fso = CreateObject("Scripting.FileSystemObject") Dim fil Set fil = fso.CreateTextFile("mailboxes.txt") Dim objItem Dim line Dim i ' Write a header row to the CSV fil.WriteLine """Server"",""Storage Group"",""Mail Store"",""Mailbox GUID"",""Display Name"",""LegacyDN"",""Size"",""Item Count"",""Associated Content Count"",""Deleted Message Size"",""Date Absent"",""Storage Limit Level""" For i = 0 To TOTAL_SERVERS - 1 Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer(i) & _ "\ROOT\MicrosoftExchangeV2") Set colItems = objWMIService.ExecQuery _ ("Select * from Exchange_Mailbox") For Each objItem in colItems line = """" & objItem.ServerName & """" line = line & "," line = line & """" & objItem.StorageGroupName & """" line = line & "," line = line & """" & objItem.StoreName & """" line = line & "," line = line & """" & objItem.MailboxGUID & """" line = line & "," line = line & """" & objItem.MailboxDisplayName & """" line = line & "," line = line & """" & objItem.LegacyDN & """" line = line & "," line = line & """" & objItem.Size & """" line = line & "," line = line & """" & objItem.TotalItems & """" line = line & "," line = line & """" & objItem.AssocContentCount & """" line = line & "," line = line & """" & objItem.DeletedMessageSizeExtended & """" line = line & "," line = line & """" & objItem.DateDiscoveredAbsentInDS & """" line = line & "," line = line & """" & objItem.StorageLimitInfo & """" fil.WriteLine line 'WScript.Echo line Next Next fil.Close Set fso = Nothing Set objWMIService = Nothing