Hi,
As I understand, you get the 403 error when getting sites and subsites which have Unique / Inheriting permissions in SharePoint Online using PowerShell.
The PowerShell script below can pass the SharePointOnline credentials.
$ctx = New-Object Microsoft.SharePoint.Client.ClientContext($webUrl)
$ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $password)
For more detailed information, you could refer to the article below.
The article below is about using PowerShell and the .NET CSOM to Query SharePoint 2013 Online.
http://blog.blumenthalit.com/blog/Lists/Posts/Post.aspx?ID=171
More reference:
The article below is about PowerShell for SharePoint online under the hood.
http://jeffreypaarhuis.com/2012/06/14/powershell-for-sharepoint-online-under-the-hood/
Best regards,
Sa