February 2013
Intermediate to advanced
304 pages
8h 26m
English
Scenario/Problem: You need to remove a site collection from your SharePoint farm.
Solution: Use the Remove-SPSite cmdlet with a site collection variable.
The Remove-SPSite cmdlet enables you to remove a specific site collection from the current server. Use this in conjunction with the Get-SPSite cmdlet (explained in a previous section), as shown in Listing 8.5, or just use the site collection identity directly in line, as shown in Listing 8.6.
Listing 8.5. Removing a Site Collection Using a Variable
$siteCol = Get-SPSite -Identity "http://sp2013/sites/sitecol"Remove-SPSite $siteCol
Listing 8.6. Removing a Site Collection Directly
Remove-SPSite -Identity "http://sp2013/sites/sitecol"
The Remove-SPSite cmdlet has ...
Read now
Unlock full access