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:
http://blogs.technet.com/b/exchange/archive/2013/08/23/recovering-public-folder-information-in-exchange-2013.aspx
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 http://help.outlook.com/en-us/140/cc952756.aspx, 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 http://help.outlook.com/en-us/140/cc952755.aspx.
Run the following PowerShell command, when prompted enter the Office 365 Administrative account details:
$LiveCred = Get-Credential $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -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