SharePoint Online: How to Change Site Owner using PowerShell?

Requirement: Change Site Owner in SharePoint Online using PowerShell

How to Change Site Owner in SharePoint Online?
Site Owners of a SharePoint Online site collections can be changed only through SharePoint Online Admin Center or PowerShell. To change site owner in SharePoint Online follow these steps:
Important: You must be either Global Administrator or SharePoint Online Administrator to change site owners in SharePoint Online!
  • Sign in to Office 365 Admin Center (https://portal.office.com/), Click on "SharePoint Admin Center" link from "Admin Centers" section. 
  • You'll be landing to Site Collections list in SharePoint Admin center (https://YourDomain-admin.sharepoint.com/_layouts/15/online/SiteCollections.aspx) with all site collections listed. 
  • Select the site collection from the list of site collections to which you want to change the site owner >> From the ribbon, Click on "Owners" and then "Manage Administrators"
  • On the "Manage Administrators" dialog box, You can change the primary site collection administrator - Site owner. You can also configure additional site collection administrators. Enter the name for primary site collection administrator and Click OK save your changes.
    change site owner sharepoint online powershell
You can add only ONE site owner (Primary Site Collection Admin) in SharePoint Online! There is no secondary admin in SharePoint Online, but you can add more than one "Site collection Administrators".

Change Site Owner SharePoint Online using PowerShell
We can change the site owner using Set-SPOSite cmdlet. Here is an example: Set the variables according to your environment.
#Variables
$AdminCenterURL = "https://crescenttech-admin.sharepoint.com/"
$SiteCollURL="https://crescenttech.sharepoint.com/Sites/marketing"
$SiteOwner = "Peter@TheCrescentTech.com"
 
#Connect to SharePoint Online
Connect-SPOService -url $AdminCenterURL -Credential (Get-Credential)
 
#Change site owner in SharePoint Online
Set-SPOSite -Identity $SiteCollURL -Owner $SiteOwner -NoWait

Here is my another post on adding site collection administrators to SharePoint Online:PowerShell to Add Site Collection Administrators in SharePoint Online
SharePoint Online: How to Change Site Owner using PowerShell? SharePoint Online: How to Change Site Owner using PowerShell? Reviewed by Salaudeen Rajack on February 07, 2018 Rating: 5

No comments:

Please Login and comment to get your questions answered!

Powered by Blogger.