Per poter elencare tutte le site collection create sullo SharePoint Online tramite PowerShell, è necessario avere installato l'ultima versione di SharePoint Online Management Shell che mette a disposizione una serie di comandi del tipo Verbo-SPOOggetto.
Se è già installata una versione precedente potrebbe essere necessario rimuoverla prima di procedere con l'installazione.

Prima di tutto bisogna connettersi al tenant con il comando Connect-SPOService:

PowerShell

$adminUPN="email  es: nome@orhName.onmicrosoft.com"
$orgName="nomeOrganizzazione"

$userCredential = Get-Credential -UserName $adminUPN -Message "Password:"
Connect-SPOService -Url https://$orgName-admin.sharepoint.com -Credential $userCredential

poi con il comando Get-SPOSite è possibile elencare tutte le site collection

PowerShell

Get-SPOSite  | select url, template

DOS / Batch file

Url                                           Owner                         Storage Quota
---                                           -----                         -------------
https://xxx.sharepoint.com/sites/AppCatalog   alberto@xxx.onmicrosoft.com         26214400
https://xxx.sharepoint.com/                                                       26214400
https://xxx.sharepoint.com/sites/godigitalA   alberto@xxx.onmicrosoft.com         26214400
https://xxx.sharepoint.com/sites/grptestaddon                                     26214400
https://xxx.sharepoint.com/search                                                 26214400
https://xxx-my.sharepoint.com/                                                    26214400
https://xxx.sharepoint.com/portals/Community                                      26214400
https://xxx.sharepoint.com/portals/hub                                            26214400
https://xxx.sharepoint.com/sites/HD                                               26214400
posso vedere con che template sono stati creati

PowerShell

Get-SPOSite

Text

Url                                           Template
---                                           --------
https://xxx.sharepoint.com/sites/AppCatalog   APPCATALOG#0
https://xxx.sharepoint.com/                   SitePagePublishing#0
https://xxx.sharepoint.com/sites/godigitalA   STS#0
https://xxx.sharepoint.com/sites/grptestaddon GROUP#0
https://xxx.sharepoint.com/search             SRCHCEN#0
https://xxx-my.sharepoint.com/                SPSMSITEHOST#0
https://xxx.sharepoint.com/portals/Community  POINTPUBLISHINGTOPIC#0
https://xxx.sharepoint.com/portals/hub        POINTPUBLISHINGHUB#0
https://xxx.sharepoint.com/sites/HD           BLANKINTERNET#0
è possibile avere il dettaglio delle proprietà di una singola site collection:

PowerShell

Get-SPOSite https://xxx.sharepoint.com | Format-List

Text

astContentModifiedDate                     : 14/04/2020 21:55:01
Status                                      : Active
ResourceUsageCurrent                        : 0
ResourceUsageAverage                        : 0
StorageUsageCurrent                         : 13
LockIssue                                   :
WebsCount                                   : 2
CompatibilityLevel                          : 15
DisableSharingForNonOwnersStatus            :
HubSiteId                                   : 00000000-0000-0000-0000-000000000000
IsHubSite                                   : False
RelatedGroupId                              : 00000000-0000-0000-0000-000000000000
GroupId                                     : 00000000-0000-0000-0000-000000000000
Url                                         : https://xxx.sharepoint.com/
LocaleId                                    : 1040
LockState                                   : Unlock
Owner                                       : 4ebd8943-a7630-4039-921d-5a7994a9f0af
StorageQuota                                : 26214400
StorageQuotaWarningLevel                    : 25574400
ResourceQuota                               : 300
ResourceQuotaWarningLevel                   : 255
Template                                    : SITEPAGEPUBLISHING#0
Title                                       : Communication site
AllowSelfServiceUpgrade                     : True
DenyAddAndCustomizePages                    : Enabled
PWAEnabled                                  : Unknown
SharingCapability                           : ExternalUserAndGuestSharing
SiteDefinedSharingCapability                : ExternalUserAndGuestSharing
SandboxedCodeActivationCapability           : Disabled
DisableCompanyWideSharingLinks              : NotDisabled
DisableAppViews                             : NotDisabled
DisableFlows                                : NotDisabled
ProtectionLevelName                         :
StorageQuotaType                            :
RestrictedToGeo                             : Unknown
ShowPeoplePickerSuggestionsForGuestUsers    : False
SharingDomainRestrictionMode                : None
SharingAllowedDomainList                    :
SharingBlockedDomainList                    :
ConditionalAccessPolicy                     : AllowFullAccess
AllowDownloadingNonWebViewableFiles         : False
LimitedAccessFileType                       : WebPreviewableFiles
AllowEditing                                : True
SensitivityLabel                            :
CommentsOnSitePagesDisabled                 : False
SocialBarOnSitePagesDisabled                : False
DefaultSharingLinkType                      : None
DefaultLinkPermission                       : None
DefaultLinkToExistingAccess                 : False
AnonymousLinkExpirationInDays               : 0
OverrideTenantAnonymousLinkExpirationPolicy : False
ExternalUserExpirationInDays                : 0
OverrideTenantExternalUserExpirationPolicy  : False
InformationSegment                          : {}
BlockDownloadLinksFileType                  : WebPreviewableFiles

Per vedere tutti i comandi SPO disponibili:

PowerShell

Get-Command *-spo*
Tags:
PowerShell200 SharePoint498 SharePoint Online75
Potrebbe interessarti anche: