Assign/Revoke Administrative Access on Deleted OneDrive Using PowerShell

Published: Updated: 1 min readOneDrive, PowerShell

When a deleted OneDrive is restored then its also important to give access to some user. The easiest way to restore a deleted OneDrive is to restore the deleted user but this is not ideal case every time, so you must restore the deleted site/OneDrive and then assign administrative access to an active user using Set-SPOUser cmdlet. This command requires the URL of OneDrive, user login name and token of administrative access.

Set-SPOUser -Site "https://mstechtalk-my.sharepoint.com/personal/aamin_mstechtalk_com" -LoginName adnan.amin@brighthousefinancial.com -IsSiteCollectionAdmin $True

Assign access OneDrive

Important: You must have administrative access to run the command.

Share:
Adnan Amin

Adnan Amin

Adnan Amin is a Microsoft MVP for Microsoft 365 (since 2015) and a Senior Microsoft Consultant. He writes practical guides and PowerShell scripts for SharePoint, OneDrive, Teams and Copilot admins.

More posts by Adnan Amin

Leave a Reply

Your email address will not be published. Required fields are marked *