Site collection administrator in SharePoint

In this SharePoint tutorial, we will discuss in detail the site collection administrator in SharePoint 2013, SharePoint 2016/2019, and SharePoint Online. We will discuss the below topics:

  • site collection administrator sharepoint 2013
  • add site collection administrator sharepoint 2013 Powershell
  • remove site collection administrator sharepoint 2013 Powershell
  • sharepoint site collection administrator responsibilities
  • remove site collection administrator PowerShell sharepoint 2013
  • PnP PowerShell to remove SharePoint Online Site Owner or Administrator
  • Remove a site owner from SharePoint Online Admin Center

Site collection administrator SharePoint 2013

The SharePoint site collection administrator will have full control over the SharePoint site. You can have one person responsible for a particular site collection, but if your organization is small, one user can also manage multiple site collections.

In a typical SharePoint on-premise environment, under a web application, there will be one or more site collections. And every site collection will have one or more subsites under it.

For example, if you have one site collection for the HR department. And, under the HR department, you can have multiple web subsites like HR-USA, HR-CANADA, or HR-UK.

Here, understand the difference between a SharePoint site owner and SharePoint site collection administrator.

You can have one site owner for the HR-USA and the owner will have full control of the HR-USA site, in the same way, HR-CANADA will have a site owner and s/he will have full control over the HR-CANADA site.

But a site collection administrator will have full control on all the sites and and sub sites under the site collection.

In a SharePoint site collection, there will be one primary site collection administrator and also you can add one secondary site collection administrator for the SharePoint 2013 site collection. The same applies to SharePoint 2016 and SharePoint 2019 sites also.

SharePoint site collection administrator responsibilities

Let us check out SharePoint site collection administrator responsibilities.

  • Since site collection administrators in sharepoint 2013 will have full control of the site collection, they can create, delete, or update SharePoint lists and libraries.
  • A primary site collection administrator SharePoint 2013 can grant permissions to users.
  • SharePoint site collection administrator can create subsites when required.

SharePoint Site Owner vs Site Collection Administrator

Often we confuse with SharePoint site owner vs site collection administrator. Let us try to understand.

In an organization, you might have one site for a department, and in each department, there might have been various subsites under it.

The SharePoint site owner will have full control of the particular site. And the site collection administrator will have full control of each and every site under the site collections.

And the SharePoint site collection administrator will have access to the site collection level features like Document ID Service, Document Sets, In Place Records Management, SharePoint Server Publishing Infrastructure, Site Policy, Video, and Rich Media, etc. Apart from this site collection administrator will have access to audit reports etc.

So, now the question comes whether which role should we provide to the user, site owner, or site collection administrator role?

The answer is it all depends on your organization structure. If there are multiple sub-sites, then you can assign the site owner role to different users. Site owners will be responsible for maintaining a small part of the SharePoint portal. At the same time, you should give the site collection administrator role to the user who will responsible be to take care of the entire site collection.

Maybe you can make one person from your HR department as your HR site collection. But if your HR department is very big and presented across the globe, then you might add additional owners for your HR-USA, HR-CANADA, HR-UK, etc. So it depends.

Add/Change Site Collection Administrator in Modern SharePoint Online Site

To change the SharePoint Site Collection Administrator in Modern SharePoint Online Site, Open “SharePoint Admin Center (New)” and click on “Site Collections“.

Go to “Active sites” which will be present under the “Sites” in the left navigation of Modern SharePoint online Admin center.

site collection administrator sharepoint 2010
how to Change Site Collection Administrator in Modern SharePoint Online

Select one Site from “Active sites” which you want to change or add the Administrator/Owner. Then click on “Owners” from the command bar and select “Change group owners” like below screenshot.

site collection administrator sharepoint online
Change Site Collection Administrators in Modern SharePoint Online

Once you will click on “Change group owners“, an owner settings page will appear on the existing page where you have to enter or re-change the administrator. Just “Save” as shown below. 

sharepoint change site collection administrator
how to Change Site Collection Administrators in Modern SharePoint Online

This is how, we can change the administrator of a SharePoint site.

Add site collection administrator SharePoint Online PowerShell

Let us see how to add site collection administrator in SharePoint online using PowerShell.

We can use the Set-SPOUser PowerShell cmdlets to add or remove a user as a site collection administrator in SharePoint Online.

Before running the command, we need to make sure that the SharePoint Online management shell has been installed in the system.

Connect-SPOService -url "https://tsinfo-admin.sharepoint.com/" -credential (Get-Credential)
$sitecollection = Get-SPOSite "https://tsinfo.sharepoint.com/sites/Marketing/"
Set-SPOUser -site $sitecollection -LoginName "bhawana@tsinfo.onmicrosoft.com" -IsSiteCollectionAdmin $True

This is how we can add site collection administrator using PowerShell in SharePoint Online Office 365.

Add site collection administrator to all sharepoint online sites using PowerShell

We can also use PowerShell to add a site collection administrator to all the SharePoint Online sites using PowerShell.

Connect-SPOService -url "https://tsinfo-admin.sharepoint.com/" -credential (Get-Credential)
$allSites = Get-SPOSite -Limit ALL
Foreach ($site in $allSites)
{
    Set-SPOUser -site $site -LoginName "bhawana@tsinfo.onmicrosoft.com" -IsSiteCollectionAdmin $True
}

This is how we can add an administrator to all SharePoint Online site collection using PowerShell.

Add site collection administrator sharepoint 2013 Powershell

Let us see how to add site collection administrator in SharePoint 2013 using PowerShell.

Add-PSSnapin Microsoft.SharePoint.PowerShell -EA SilentlyContinue
$siteURL = "http://mypc:29024/sites/SPTraining/"
$newadministrator="TSInfo\Bijay"
$web= Get-SPWeb $siteURL
$user = $web.EnsureUser($newadministrator)
$user.IsSiteAdmin = $true
 $user.Update()

Once you execute the above PowerShell script, it will add site collection administrator in SharePoint 2013 using PowerShell. The same PowerShell script will work in SharePoint 2016 and SharePoint 2019 also.

Also, below is a powerful SharePoint PowerShell cmdlets which allows a SharePoint farm administrators to change the ownership of a SharePoint site collection onto which they do not have access to.

Add-PSSnapin Microsoft.SharePoint.PowerShell -EA SilentlyContinue
$siteURL = "http://mypc:29024/sites/SPTraining/"
Set-SPSiteAdministration $siteURL -OwnerAlias "TSInfo\Bijay"

Add site collection administrator SharePoint Online PowerShell CSOM

Now, let us see how to add site collection administrator in SharePoint Online using CSOM PowerShell.

Add-Type -Path "C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll"
Add-Type -Path "C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
$SPOnlineUserName="Bijay@tsinfo.onmicrosoft.com"
$SPOnlinePassword="***********"
$SiteURL = "https://tsinfo.sharepoint.com/sites/Marketing/"
$ctx= New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL)
$securePassword=ConvertTo-SecureString $SPOnlinePassword -AsPlainText -Force
$ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($SPOnlineUserName, $securePassword)
$users = $ctx.Web.EnsureUser("i:0#.f|membership|bhawana@tsinfo.onmicrosoft.com")
$users.IsSiteAdmin = $True
$users.Update()
$ctx.ExecuteQuery()

This is how we can add site collection administrators to SharePoint Online site using CSOM PowerShell.

Add site collection administrator in SharePoint Online using PnP PowerShell

Let us see how to add site collection administrator in SharePoint Online site using PnP PowerShell.

$SiteURL = "https://tsinfo.sharepoint.com/sites/Marketing/"
Connect-PnPOnline -Url $SiteURL -Credentials (Get-Credential)
Add-PnPSiteCollectionAdmin -Owners "bhawana@tsinfo.onmicrosoft.com"

This is how we can add site collection administrator in SharePoint Online site using PnP PowerShell.

Add SharePoint site collection administrator programmatically using C#

We can also add SharePoint site collection administrator programmatically using C#. We will use here SharePoint server object model. The code you can use in a SharePoint visual web part. Also, you can develop, debug, and test the code in a console application or windows application, provided you SharePoint server 2013 or SharePoint 2016 or 2019 should be installed in the machine.

string newadmin=@"TSInfo\Bijay";

using(SPSite site=new SPSite("http://mypc:29024/sites/SPTraining/"))
{
    using (SPWeb web = site.RootWeb)
      {
         SPUser user = web.EnsureUser(newadmin);
         user.IsSiteAdmin = true;
         user.Update();
       }
}

This code, we can use to add site collection administrator programmatically using C# in SharePoint 2013/2016 or SharePoint 2019.

Change SharePoint Site Collection Administrator

Let us see how to change the SharePoint Site Collection Administrator in SharePoint Online and SharePoint 2019/2016/2013.

Change Site Collection Administrator in SharePoint 2019/2016/2013

To change SharePoint 2019 site collection administrator, Open “SharePoint 2019 Central Administration” and click on “Application Management” as shown below.

site collection administrator sharepoint 2013
change site collection administrator in sharepoint 2019

Once you will click on the “Application Management“, It will show you that management page where four types of applications will be present as like:

  • Web Applications
  • Site Collections
  • Service Applications
  • Databases

Click on the “Change site collection administrators” option which is present under the “Site Collections” in SharePoint central administration as like below screenshot.

SharePoint change site collection administrator
how to change site collection administrator in sharepoint 2019

After clicking on the “Change site collection administrator” option, an administrator settings page will come. Under the “Primary site collection administrator” and “Secondary site collection administrator” field, you have to enter or re-change the administrator. Just click on “OK”.

SharePoint 2013 change site collection administrator
add site collection administrator in sharepoint 2019

Change Site Collection Administrator in SharePoint Online

To change SharePoint Online Site Collection administrator, Go to the “SharePoint Online Admin Center” and click on “Site collections” as shown below. Select one site which you want to change the administrator. Once you will select the site, the ribbon options will enable (Previously some of the options were disabled).

Click on “Owners” option and then select “Manage Administrators” as shown in below.

sharepoint change site collection administrator
change site collection administrator in SharePoint online

After clicking on the “Manage Administrators” option, an administrator settings page will come. In the “Primary Site Collection Administrator” and “Site Collection Administrator” field, you have to enter or re-change the administrator. Just click on “OK”.

site collection administrator sharepoint 2013
how to change site collection administrator in SharePoint online

Remove SharePoint Online Site Collection Administrator using PowerShell

In this PowerShell tutorial, we will discuss how to remove SharePoint Online Site Collection Administrator using PowerShell.

We will see here, how to remove site collection administrators from SharePoint classic and modern sites using the browser in SharePoint Online Office 365.

Remove SharePoint Online Site Collection Administrator (Classic Team Site)

We can easily remove the SharePoint Online site collection administrator from SharePoint Online classic sites.

Open SharePoint Site, click on the Gear icon -> Site Settings.

Then in the Site Settings page, click on Site Collection Administrators which is under users and permissions.

remove SharePoint Online Site Collection Administrator

Then you can remove the administrators from the Site collection administrators.

how to remove SharePoint Online Site Collection Administrator

This way we can remove a site collection administrator from the SharePoint Online classic site collection.

Remove SharePoint Online Site Collection Administrator (Modern Team Site)

Removing the SharePoint site collection administrators is different in the modern site from the classic site.

Open SharePoint Online modern team site. Click on the gear icon and then click on Site permissions.

remove site collection administrator sharepoint online

Then click on the Site owners Office 365 groups.

remove site collection administrator sharepoint online modern site

Then in the next dialog box, click on Members, and then you can see all the Role as Owner, and then you can the Delete icon to remove the SharePoint Online site administrator or the owner.

remove site collection administrator powershell sharepoint online

This is how we can remove the SharePoint Online site administrator from the modern SharePoint sites.

Remove a site owner from SharePoint Online Admin Center

Anytime, you can remove a Site owner or administrator from the SharePoint Online admin center.

Login to the SharePoint Online admin center.

https://<Your tenant name>-admin.sharepoint.com/

Then click on Sites -> Active Sites which will display all the active sites in SharePoint Online.

Select any site and then click on the particular site. Then click on the Permissions tab. And then expend Site admins and click on Manage.

remove site owner from sharepoint online site

Then in the Manage admins page, click on Delete icon on the owner which you want to remove.

how to remove site owner from sharepoint online site
remove site collection administrator powershell sharepoint online

This is how we can remove the site collection administrator from a SharePoint Online site.

Remove SharePoint Online site collection administrator using PowerShell

Now, we will see how to remove the SharePoint Online site collection administrator using the SharePoint Online management shell.

We can also use the PowerShell ISE to run the below script to remove the site collection administrator from the SharePoint Online site.

Connect-SPOService -url "https://tsinfo-admin.sharepoint.com/" -credential (Get-Credential)
$sitecollection = Get-SPOSite "https://tsinfo.sharepoint.com/sites/TSInfoClassic/"
Set-SPOUser -site $sitecollection -LoginName "bhawana@tsinfo.onmicrosoft.com" -IsSiteCollectionAdmin $False

The above script will change the user from administrator or owner to a member.

If you want to remove the user from the SharePoint site, then you can use the Remove-SPOUser cmdlet.

Connect-SPOService -url "https://tsinfo-admin.sharepoint.com/" -credential (Get-Credential)
$sitecollection = Get-SPOSite "https://tsinfo.sharepoint.com/sites/SPFxTraining"
Remove-SPOUser -Site https://tsinfo.sharepoint.com/sites/SPFxTraining -LoginName bhawana@tsinfo.onmicrosoft.com

Remove site collection administrator from all sharepoint online sites using PowerShell

We can also use PowerShell to remove a site collection administrator from all the SharePoint Online sites using PowerShell.

Connect-SPOService -url "https://tsinfo-admin.sharepoint.com/" -credential (Get-Credential)
$allSites = Get-SPOSite -Limit ALL
Foreach ($site in $allSites)
{
    Set-SPOUser -site $site -LoginName "bhawana@tsinfo.onmicrosoft.com" -IsSiteCollectionAdmin $False
}

This is how we can remove an administrator from all SharePoint Online site collection using PowerShell.

PnP PowerShell to remove SharePoint Online Site Owner or Administrator

We can also use PnP PowerShell to remove the SharePoint site owner or administrator.

You can run the below script.

Connect-PnPOnline -Url "https://tsinfo.sharepoint.com/sites/SPFxTraining/" -Credentials (Get-Credential)
Remove-PnPSiteCollectionAdmin -Owners "bhawana@tsinfo.onmicrosoft.com"
remove site collection administrator powershell
remove site collection administrator powershell

Note: Make sure you have installed SharePointPnPPowerShellOnline, else you will get the error Connect-PnPOnline The term Connect-PnPOnline is not recognized as the name of a cmdlet.

In this SharePoint tutorial, we learned about SharePoint site collection administrator, how to remove SharePoint Online Site Collection Administrator using PowerShell as well as using PnP PowerShell.

Also, we saw how to remove SharePoint site owner from SharePoint Online modern site as well from SharePoint online admin center. Cover the below topics:

  • Site collection administrator SharePoint 2013
  • SharePoint site collection administrator responsibilities
  • SharePoint Site Owner vs Site Collection Administrator
  • Add/Change Site Collection Administrator in Modern SharePoint Online Site
  • Add site collection administrator SharePoint Online PowerShell
  • Add site collection administrator to all sharepoint online sites using PowerShell
  • Add site collection administrator sharepoint 2013 Powershell
  • Add site collection administrator SharePoint Online PowerShell CSOM
  • Add site collection administrator in SharePoint Online using PnP PowerShell
  • Add SharePoint site collection administrator programmatically using C#
  • Change SharePoint Site Collection Administrator
  • Change Site Collection Administrator in SharePoint 2019/2016/2013
  • Change Site Collection Administrator in SharePoint Online
  • Remove SharePoint Online Site Collection Administrator using PowerShell
  • Remove SharePoint Online Site Collection Administrator (Classic Team Site)
  • Remove SharePoint Online Site Collection Administrator (Modern Team Site)
  • Remove a site owner from SharePoint Online Admin Center
  • Remove SharePoint Online site collection administrator using PowerShell
  • Remove site collection administrator from all sharepoint online sites using PowerShell
  • PnP PowerShell to remove SharePoint Online Site Owner or Administrator
>