Skip to content

Recover Public Folders in Office 365/Exchange 2013

One of our clients had a very scary experience today when a whole bunch (15GB+) of Public Folders went missing, gulp!!!

They started off recovering from deleted items using Outlook, but this was painfully slow, luckily enough that gave them enough time to find the following article:

But they weren’t confident enough to fire up Powershell and script the recover so we dived in….

Install and Configure Windows PowerShell

To configure additional options for Office 365 you’ll need to make sure PowerShell is installed and configured as per, Windows 7 has the correct versions installed so just make sure you enable scripts to run by running the following PowerShell command:

Set-ExecutionPolicy RemoteSigned

Then configure Windows Remote Management to support Basic Authentication by running the following command:

winrm set winrm/config/client/auth @{Basic=”true”}

Connect Windows PowerShell to the Service

Once installed and configured you need to connect PowerShell to Office 365 as per

Run the following PowerShell command, when prompted enter the Office 365 Administrative account details:

$LiveCred = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri -Credential $LiveCred -Authentication Basic –AllowRedirection
Import-PSSession $Session

Recover Deleted Public Folders

Run the following command to get the list of folders not in the tree

Get-PublicFolder –Identity "NON_IPM_SUBTREE" –Recurse | SELECT Identity

We then used then filtered this list to ensure we had just the list of folders to restore, the only pain point being knowing where they needed restoring to.

You then can restore each folder using a command like the below and it’s pretty much instant, it even does subfolders!

Set-PublicFolder –Identity "\NON_IPM_SUBTREE\DUMPSTER_ROOT\<GUID>\Test-3" –Path "\" –Verbose
Back To Top