Display All Available Site Collections on the Farm

Scenario/Problem: You need to obtain a site collection reference and therefore need a listing of available site collection URLs.

Solution: Use the Get-SPSite cmdlet without any parameters to retrieve all available site collections.

To obtain a site collection reference object, you need to find the URL (Identity) of the site collection. Using the Get-SPSite cmdlet by itself (see Listing 8.1) displays all available site collections, as shown in Figure 8.1.

Listing 8.1. Displaying All Available Site Collections

Get-SPSite

Image

Figure 8.1. The Get-SPSite cmdlet displays all available sites.

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.