Created
May 31, 2018 21:18
-
-
Save mitchellurgero/6bc3218df6fb7ef1904ce636590e444b to your computer and use it in GitHub Desktop.
Search Exchange 2013/2016 for emails and put into a PST file (Powershell!)
This file contains hidden or 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
# Search All mailbox's on the server: | |
Get-mailboxserver -identity "SERVERNAME" | search-mailbox -searchquery "Search query as you would type it in Outlook" -targetmailbox "USERNAMEOFTARGETMAILBOX" -TargetFolder "NEWFOLDERTOPUTSEARCHIN" -loglevel full | |
# Search One mailbox on the server: | |
search-mailbox -Identity "USERNAME" -searchquery "Search query as you would type it in Outlook" -targetmailbox "USERNAMEOFTARGETMAILBOX" -TargetFolder "NEWFOLDERTOPUTSEARCHIN" -loglevel full | |
# Explination: | |
# USERNAMEOFTARGETMAILBOX - The mailbox the search results will be pulled into. (E.G: administrator) | |
# NEWFOLDERTOPUTSEARCHIN - The folder to put the search results in. (E.G: New Folder For Emails) | |
# Export the above to PST: | |
New-MailboxExportRequest -Mailbox "USERNAMEOFTARGETMAILBOX" -IncludeFolders "NEWFOLDERTOPUTSEARCHIN" -FilePath \\localhost\D$\path\to\store\pst | |
## Be sure to change filepath to match your needs in the export! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment