This PowerShell script is used to grant admin permissions to a user's OneDrive account, even if the user has been deleted from Active Directory.
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)
Import-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
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.