Exchange 2003条带电子邮件附件保存到用户文件

我目前正在使用这个vba脚本(本地客户端)将用户文件夹中的电子邮件附件剥离并移动到用户文档文件夹,然后用电子邮件中的指针replace以引用附件。

Public Sub SaveOLFolderAttachments() Dim oShell As Object Set oShell = CreateObject("Shell.Application") Dim fsSaveFolder As Object Set fsSaveFolder = oShell.BrowseForFolder(0, "Please Select a Save Folder:", 1) If fsSaveFolder Is Nothing Then Exit Sub ' Note: BrowseForFolder doesn't add a trailing slash ' Ask the user to select an Outlook folder to process Dim olPurgeFolder As Outlook.MAPIFolder Set olPurgeFolder = Outlook.GetNamespace("MAPI").PickFolder If olPurgeFolder Is Nothing Then Exit Sub ' Iteration variables Dim msg As Outlook.MailItem Dim att As Outlook.attachment Dim sSavePathFS As String Dim sDelAtts For Each msg In olPurgeFolder.Items sDelAtts = "" If msg.Attachments.Count > 0 Then While msg.Attachments.Count > 0 ' Save the file sSavePathFS = fsSaveFolder.Self.Path & "\" & msg.Attachments(1).FileName msg.Attachments(1).SaveAsFile sSavePathFS If msg.BodyFormat <> olFormatHTML Then sDelAtts = sDelAtts & vbCrLf & "<file://" & sSavePathFS & ">" Else sDelAtts = sDelAtts & "<br>" & "<a href='file://" & sSavePathFS & "'>" & sSavePathFS & "</a>" End If msg.Attachments(1).Delete Wend If msg.BodyFormat <> olFormatHTML Then msg.Body = msg.Body & vbCrLf & vbCrLf & "Attachments Deleted: " & Date & " " & Time & vbCrLf & vbCrLf & "Saved To: " & vbCrLf & sDelAtts Else msg.HTMLBody = msg.HTMLBody & "<p></p><p>" & "Attachments Deleted: " & Date & " " & Time & vbCrLf & vbCrLf & "Saved To: " & vbCrLf & sDelAtts & "</p>" End If msg.Save End If Next End Sub 

它在小范围内工作良好,但对于多个用户和文件夹变得非常繁琐。 我想知道是否有办法做到这一点,也许在PowerShell中,我可以循环所有的用户和用户文件夹兑换服务器本身?

Exchange 2003 / Windows Server 2003

??

谢谢