First, you need to change the variables in the script below to the values that you need
Second, you need to sign into the SPO Service as a global administrator (or at least a SharePoint Administrator)
Install-Module -Name Microsoft.Online.SharePoint.PowerShell
# --- Change these variables ---
$SPAdminURL = "https://contoso-admin.sharepoint.com"
$OneDriveURL = "https://contoso-my.sharepoint.com/personal/user_contoso_com"
$AcctName = "grantAccessUser@contoso.com"
Connect-SPOService -Url $SPAdminURL
Set-SPOUser -Site $OneDriveURL -IsSiteCollectionAdmin $true -LoginName $AcctName
# --- Change these variables ---
$SPAdminURL = "https://contoso-admin.sharepoint.com"
$OneDriveURL = "https://contoso-my.sharepoint.com/personal/user_contoso_com"
$AcctName = "grantAccessUser@contoso.com"
Connect-SPOService -Url $SPAdminURL
Set-SPOUser -Site $OneDriveURL -IsSiteCollectionAdmin $true -LoginName $AcctName
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.