When we login into sp online tenant site, we can see site coll admins of sites to which we donot have access. Is it possible to retrieve primary and secondary admin of all site collection without having to add a user account as administrator using powershell.
I’m afraid we can not get all administrator without a administrator account. I have tried with a full control account but it did not return any value.
Pnp powershell code for your reference:
$cred = Get-Credential Connect-PnPOnline -Url https://contoso.sharepoint.com/sites/dev -Credential $cred Get-PnPSiteCollectionAdmin
Download pnp powershell Here: