403 Forbidden means that the authentication was provided, but the authenticated user is not permitted to perform the requested operation.
And Global admins and SharePoint admins don't have automatic access to all sites and each user's OneDrive, but they can give themselves access to any site or OneDrive.
You could run the following script code to add a Site Collection Administrator to OneDrive for Business
# install PnP module
Install-Module SharePointPnPPowerShellOnline
#Set Variables
$SiteURL = "https://testlz-my.sharepoint.com/personal/***_com/"
$AdminName=" *** "
$Password = " *** "
#Connect to PnP Online
$cred = New-Object -TypeName System.Management.Automation.PSCredential -argumentlist $AdminName, $(convertto-securestring $Password -asplaintext -force)
Connect-PnPOnline -url $SiteURL -Credential $cred
Add-PnPSiteCollectionAdmin -Owners "***@***.***.com"
Thanks,
Echo Du
----------
If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.