Get a Specific Deleted Site Collection

Scenario/Problem: You need to obtain a specific deleted site collection reference.

Solution: Use the Get-SPDeletedSite cmdlet to assign a variable the results using the -Identity parameter.

Providing the identity of the deleted site collection with the Get-SPDeletedSite cmdlet retrieves a specific site collection. Use this to assign the results to an object for use in other cmdlets, as shown in Listing 8.20.

Listing 8.20. Assigning a Variable to a Specific Deleted Site Collection

$deletedSiteCol = Get-SPDeletedSite -Identity " /sites/deletedsitecol"

The Identity parameter, in this case, is the path shown when retrieving all site collections (Get-SPDeletedSite).

Get PowerShell™ for SharePoint® 2013 How-To now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.