to know who have SCA access on tenant

Brass Contributor

Hello Team,

 

Please update us is there any way to get the report or name of the users who have permission of site collection administration on SharePoint online tenant. 

 Is there any script for power shell because its very difficult to find name by going each and every site collection on tenant.

 

Regards,

Reena Roy

 

  

4 Replies

Try this script and To run this you must be a SharePoint Online global administrator and a site collection administrator

$Creds = Get-Credential

  $site = ‘https://tenant-admin.sharepoint.com’

Connect-SPOService -Url $site -Credential $Creds

$AllSites= Get-SPOSite -Limit All

$users = @();
foreach ($Allsite in $AllSites)
{

$AllUsers = Get-SPOUser -Site $AllSite.Url -Limit all | select DisplayName, LoginName,IsSiteAdmin
$users+=$AllUsers
$AllUsers = $null
#Write-Host $AllSite.Url" completed"

}
$users | Export-Csv -Path "C:\Users\Desktop\allusers.csv" -NoTypeInformation -Force

$Data = Import-Csv "C:\Users\Desktop\allusers.csv"

foreach($aUser in $Data)

{

  if($aUser.IsSiteAdmin -eq “True”)

  {

    Write-Host $aUser.DisplayName $aUser.LoginName

  }
  }

 Hope this helps 

Thanks Ganeshan, and sorry for the late response. I will run this script if i can get the report and will update you. :)

Sure 

Hello Ganesan,

Hope you are doing good.

Could you please update me is there any way or any script for giving SCA(Site Collection Administrator) rights for single user on all Site collections over SharePoint O365 tenant so that i can run the above script that you have provided. Because i am share point administrator and i have run the above script, getting error of access denied.

Regards,
Reena Roy