Placing a Office 365 group on legal hold and accessing content from a Preservation Hold Library

Sriram Varadarajan
Enterprise Architect
Published On :   25 Jul 2016
Visit Count
Today :  1    Total :   3686
Plan, Migrate, Secure, Report
SharePoint & Office 365 Tool. Simple & Easy to Use. 15-Day Trial!

Sharegate: Kick-Ass Tool
Think Your SharePoint & Office 365 Are Secure ? Find Out Now!

The site created for Office 365 group can be put on hold. Any content deleted shall be moved to Preservation Hold Library. But, accessing “Preservation Hold Library “from UI is currently a challenge since site contents page redirects users to the document library again. This seems to be expected since adding new lists such as document library is not allowed in this site. To ensure this, the site contents seems to have been blocked and instead redirects to document library again.

I would appreciate everyone to read my previous article to know about e-Discovery, this article would be a continuation of that.

Here are the list of workarounds that can be done to access the contents

1. We can use SharePoint designer to access this contents. We can browse to the library and copy the contents from SharePoint designer

2. We can open the site in explorer view and copy the content.

3. Following PowerShell script that browses to the library and downloads the file in mentioned location.

 $loadInfo1 = [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client")
 $loadInfo2 = [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client.Runtime")
 $webUrl = Read-Host -Prompt "HTTPS URL for your SP Online 2013 site" 
 $username = Read-Host -Prompt "Email address for logging into that site"
 $password = Read-Host -Prompt "Password for $username" -AsSecureString
 $ctx = New-Object Microsoft.SharePoint.Client.ClientContext($webUrl) 
 $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $password)
 $ctx.RequestTimeout = [System.Threading.Timeout]::Infinite
 $web = $ctx.Web
 $list=$web.Lists.GetByTitle("Preservation Hold Library");
 $query=new-object Microsoft.SharePoint.Client.CamlQuery
 $destinationPath = "" #Enter location within quotes
 function recur_folder($item,$destinationPath)
 if($item.FileSystemObjectType -ne "File")
         $folderName = $item["FileLeafRef"];
         $folderPath1 = $item["FileRef"];
         New-Item -ItemType directory -Path $pathOfFolder;
         $folderQuery=New-Object Microsoft.SharePoint.Client.CamlQuery;
         $pathOfFolder= $pathOfFolder+"\"
         foreach($folderItem in $folderItems)
             recur_folder $folderItem $pathOfFolder  
          Write-Host "Saving " $item["FileRef"]
          $fileRef = $item["FileRef"]
          $fileInfo = [Microsoft.SharePoint.Client.File]::OpenBinaryDirect($ctx,$fileRef.ToString())
          $new = $destinationPath + $item["FileLeafRef"]
          [byte]$byte = ""
          $list = New-Object System.Collections.Generic.List[byte]
          try {
          while(($byte = $fileInfo.Stream.ReadByte()) -ne -1)
          } catch [Exception] {
          [System.IO.File]::WriteAllBytes($new, $list.ToArray());
 foreach($item in $items)
 recur_folder $item $destinationPath


MS is the process of fixing this issue with the new Security and compliance roadmap…

SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.

KWizCom Scan