Forum Discussion

Ted McLaughlin's avatar
Ted McLaughlin
Brass Contributor
May 23, 2018

Changing ODFB site ownership after user left the company

Unfortunately my company doesn't delete users when they leave, (they just get put in a special OU), so the ODFB thing of reverting a site to their boss never kicks in.

 

So now I'm trying to change 3 departed employee's accounts to their boss, and no matter what I do I can't get it to work.  Here is what I am typing:

 

PS C:\Data\Scripts> Set-SPOUser -Site https://tenant-my.sharepoint.com/personal/
faith_smith_123_com -LoginName david.johnson@123.com -IsSiteCollectionAdmin $true

Set-SPOUser : File Not Found.
At line:1 char:1
+ Set-SPOUser -Site
https://tenant-my.sharepoint.com/personal/faith_smith_123_com ...
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Set-SPOUser], ServerException
+ FullyQualifiedErrorId : Microsoft.SharePoint.Client.ServerException,Micr
osoft.Online.SharePoint.PowerShell.SetSPOUser

 

I've gone through a bunch of sites on the internet, and they all have more or less the same command.  I've trying a bunch of things like adding caps, no caps, removing the word tenant-, and so on, but nothing works.  

 

I've gone to my ODFB site, and then changed my name to her name, and get a message back saying you don't have access to this resource, so I assume that the site is there.

 

I have 2 other users that I am trying to update and this isn't working for any of the three.  I get the same response on all of them.

 

Any suggestions are much appreciated.

 

Ted

 

 

  • Have you tried to add the new admins through the Office 365 Portal (user details pane) or the user profiles options in the SPO Admin Center?
    • Ted McLaughlin's avatar
      Ted McLaughlin
      Brass 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

    • Ted McLaughlin's avatar
      Ted McLaughlin
      Brass 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

Resources