Getting your Office 365 tenant’s SharePoint site structure with PowerShell

Update 12 June 2018: Updated cmdlets to follow the newer PnP naming standards (e.g. Connect-PnPOnline instead of Connect-SPOnline). Introduction From time to time you may want to get an overview of the structure of your SharePoint Online environment. That is, you want to know the number of site collections and subsites, and know how they are organised. While you could review the existing site collections either in the UI (not Details