0
Reply

retrieving site collection administrators on OneDrive

mgm tech

mgm tech

Oct 19 2017 1:03 PM
166

I got this weird issue and hopefully you guys can help me.
I am trying to run a powershell to retrieve who is a Site Collection Administrators on OneDrive for business on my tenant.

Tenant Name: https://tenadmin.test.com
Mysite/Onedrive URL - https://myplace.test.com
john doe one drive url - https://myplace.test.com/personal/johndoe_test_com
powershell to find who has SCA
$spousers = Get-SPOUser -Site https://myplace.test.com/personal/johndoe_test_com
$spousers | select LoginName, IsSiteAdmin

LoginName IsSiteAdmin
--------- -----------
[email protected] False
[email protected] False

The output show John Doe is not Siteadmin (False). However, when I manually check "manage user profile" I do see John Doe is a Site collection administrators.

I suspect the URL/naming of the one drive got something to do with it.

I have ran the same command on my other tenant and I got the correct result.

tenant name: https://test365-admin.sharepoint.com
onedrive URL - https://test365-my.sharepoint.com/personal/johndoe_test_onmicrosoft_com

$spousers = Get-SPOUser -Sitehttps://test365-my.sharepoint.com/personal/johndoe_test_onmicrosoft_com
$spousers | select LoginName, IsSiteAdmin
LoginName IsSiteAdmin
--------- -----------
[email protected] True
[email protected] True


Seems like it my personal site name got something to do with it. Any help on this would be appreciated.