-
-
Save ykfq/6289051a92f3abcb787f631e03cabc37 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$path = '\\server\path\' | |
$mailboxes = get-mailbox somemailboxfilter | |
$mailboxes | % { | |
$folders = Get-MailboxFolderStatistics $_.Alias -archive | |
$folders = $folders | ? {$_.Name -ne "Top of Information Store"} | |
$excludeFolders = $folders | % { $_.FolderPath.Substring(1) } | |
New-MailboxExportRequest -Mailbox $_.Alias -ExcludeFolders $excludeFolders -ExcludeDumpster -IsArchive -FilePath ($path + $_.Alias + '.pst') | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment