Get-PnPTenantSite

Retrieve site information.

Syntax

Get-PnPTenantSite
   [-Url <String>]
                    [-Template <String>]
                    [-Detailed [<SwitchParameter>]]
                    [-IncludeOneDriveSites [<SwitchParameter>]]
                    [-Filter <String>]
                    [-Connection <SPOnlineConnection>]

Description

Use this cmdlet to retrieve site information from your tenant administration.

Examples

------------------EXAMPLE 1------------------

Get-PnPTenantSite

Returns all site collections

------------------EXAMPLE 2------------------

Get-PnPTenantSite -Url http://tenant.sharepoint.com/sites/projects

Returns information about the project site

------------------EXAMPLE 3------------------

Get-PnPTenantSite -Detailed

Returns all sites with the full details of these sites

------------------EXAMPLE 4------------------

Get-PnPTenantSite -IncludeOneDriveSites

Returns all sites including all OneDrive for Business sites

------------------EXAMPLE 5------------------

Get-PnPTenantSite -IncludeOneDriveSites -Filter "Url -like '-my.sharepoint.com/personal/'"

Returns all OneDrive for Business sites

------------------EXAMPLE 6------------------

Get-PnPTenantSite -Template SITEPAGEPUBLISHING#0

Returns all Communication sites

------------------EXAMPLE 7------------------

Get-PnPTenantSite -Filter "Url -like 'sales'"

Returns all sites including 'sales' in the url

Optional Parameters

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type:SPOnlineConnection
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-Detailed

By default, not all returned attributes are populated. This switch populates all attributes. It can take several seconds to run. Without this, some attributes will show default values that may not be correct.

Type:SwitchParameter
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-Filter

Specifies the script block of the server-side filter to apply. See https://technet.microsoft.com/en-us/library/fp161380.aspx

Type:String
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-IncludeOneDriveSites

By default, the OneDrives are not returned. This switch includes all OneDrives.

Type:SwitchParameter
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-Template

By default, all sites will be returned. Specify a template value alike "STS#0" here to filter on the template

Type:String
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-Url

The URL of the site

Type:String
Aliases:Identity
Position:0
Accept pipeline input:True
Accept wildcard characters:False

Outputs

Microsoft.Online.SharePoint.TenantAdministration.SiteProperties