OneDrive – Replace ownership with PowerShell

If you need take ownership of an employees OneDrive, run the following PowerShell code.
Some requirements before running the script.

  • Azure Active Directory PowerShell Module: https://msdn.microsoft.com/en-us/library/azure/jj151815(v=azure.98).aspx
  • SharePoint Online Management Shell: https://www.microsoft.com/en-us/download/details.aspx?id=35588

In the “$OneDriveURL” replace “myuser_contoso_com” content with your “$NewOwner“, but instead of dots (“.“) use underscores (“_“).

Experienced advanced operations engineer with a demonstrated history of working in the information technology and services industry. Skilled in Windows Server, Azure, Ethical Hacking, Office 365, Exchange, Jenkins, SCCM, Octopus Deploy and PowerShell to name a few. Strong engineering professional with a big passion for knowledge.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.