Skip to content

Get-Sites-Html

SharePoint Online: HTML report of sites

#Requires -Version 5.1
#Requires -Modules Microsoft.Online.SharePoint.PowerShell

[CmdletBinding()]
Param(
    [switch]$Detailed,
    [int]$Limit = 200,
    [ValidateSet('*','Title','Status','Url','DisableFlows','AllowEditing','LastContentModifiedDate','CommentsOnSitePagesDisabled')]
    [string[]]$Properties = @('Title','Status','Url','DisableFlows','AllowEditing','LastContentModifiedDate','CommentsOnSitePagesDisabled')
)

Process {
    try {
        if ($Properties -contains '*') { $Properties = @('*') }
        $cmdArgs = @{ ErrorAction = 'Stop'; Detailed = $Detailed; Limit = $Limit }
        $result = Get-SPOSite @cmdArgs | Select-Object $Properties | Sort-Object Title
        Write-Output ($result | ConvertTo-Html -Fragment)
    }
    catch { throw }
}
Off

Use this to get additional property information

Maximum number of site collections to return

List of properties to return; use * for all properties

An interactive directory of PowerShell scripts.