PowerShell script to delete all site collection admins and make one collection admin

Copper Contributor

Hello,

 

I am currently trying to disable a OneDrive for my organisation. It works pretty well for new users, but old ones got access. I worked out one solution - when I take away collection admin rights user cannot use OneDrive anymore.

 

But I have 1000 users, and I will die changing permissions by hand, therefore is there any script to set all site collection admins to one person?

 

I mean those settings:

 

F0RCE_0-1610971356931.png

 

0 Replies