Just using your script to grab the OD4B usage details, when running the script I'm receiving below error each time it queries someone's URL. Any ideas? I'm running the script as an O365 Global Admin.
an access denied and 401 unauthorized message
This is what it looks like for each OD4B site the script queries:
Storage: Percentage used: Storage free: 1099511627776 Processing https://tenantname-my.sharepoint.com/personal/firstname_lastname_tenantname_com Exception calling "ExecuteQuery" with "0" argument(s): "Access denied. You do not have permission to perform this acti At C:\Users\Matt\Downloads\UsageReportWithCSOM.ps1:56 char:3 + $ctx.ExecuteQuery() + ~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : ServerUnauthorizedAccessException
Percentage used: Storage free: 1099511627776 Processing https://tenantname-my.sharepoint.com/personal/firstname_lastname_tenantname_com Exception calling "ExecuteQuery" with "0" argument(s): "The remote server returned an error: (401) Unauthorized." At C:\Users\Matt\Downloads\UsageReportWithCSOM.ps1:52 char:3 + $ctx.ExecuteQuery() + ~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : WebException