Forum Discussion
reenaroycs
Dec 24, 2018Brass Contributor
to know who have SCA access on tenant
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 ...
Thuyavan Ganesan
Dec 24, 2018Steel Contributor
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
reenaroycs
Dec 26, 2018Brass Contributor
Thanks Ganeshan, and sorry for the late response. I will run this script if i can get the report and will update you. :)
- Thuyavan GanesanDec 26, 2018Steel Contributor
Sure
- reenaroycsDec 27, 2018Brass ContributorHello 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