Forum Discussion
Changing ODFB site ownership after user left the company
- Ted McLaughlinMay 24, 2018Brass Contributor
Okay, this is weird . I went through the admin portal and manually took over all 3 account's Onedrive. I then clicked on the link to have it open the user's onedrive location.
In the location that popped up it said that there was no data other than an empty attachments folder. That was it. While we are kind of new to onedrive, and I can see the possibility that many users haven't put data in them, what we have done is redirect all C:\users\ted folder's to the onedrive folder. That way all of that info is sync'd up to the cloud.
So even if the user hasn't put any data in there then there still should be a Desktop, Downloads, My Documents, My Pictures, etc. I can't figure out why nothing shows but an attachments folder
- Ted McLaughlinMay 23, 2018Brass Contributor
Sorry, I should have pointed out that my goal was to make this into a script that I could run against a spreadsheet of users who had left the company.
With thousands of users I have a feeling that this is going to be happening a lot. One manager mentioned just making it part of the offboarding process that all employess account's undergo. If that happens I'll have to do this for every user who leaves the company, and I SERIOUSLY do not want to have to do that manually. My hope is that I can get a weekly spreadsheet of everyone who has left the company and then run this script against that.
Ted- DeletedMay 23, 2018
Here is my notes, make sure you have the latest powershell module installed, and make sure you connect to the -admin tenant as shown below. and make sure you run the SharePoint Online Powershell that gets installed as Admin.
How to connect PowerShell to Office 365
You must download and install SharePoint Online Management Shell
https://www.microsoft.com/en-us/download/details.aspx?id=35588
Run Sharepoint Online Management Shell
Run as adminHow to grant admin access to OneDrive account
To add access to Site collection
Connect-SPOService -Url https://tenant-admin.sharepoint.com -credential globaladminusername@tenant.org
Set-SPOUser -Site https://tenant-my.sharepoint.com/personal/targerusername_tenant_org -LoginName usernamethatneedsadded@tenant.org -IsSiteCollectionAdmin $true