I've run into a situation where my main administration account is missing the site collection administrator rights.
The account in question did:
- Create the site collections.
- Stands as primary site collection administrator.
- Got owner rights.
But still the extra settings are missing from some of the collections site settings. From some of the site collections i got full access to the extra settings. I am at the root site for every site.
I've tried to re-set the primary administrator but it does not change anything. Logging in as my secondary admin account, i got full rights on all the sites.
Trying to access a URL like _layouts/15/mngsiteadmin.aspx give's me access denied.
Update
Running a PowerShell script which returns all the site collections and the administrator in my faulting web application, it only returns the one where i got administrator privileges. What could be wrong?
Update 2
Logging into with my secondary admin account, accessing the site collection administrators, my primary is missing, even after resetting it from central admin. Are the site broken or is this a bug? Anyone familiar with this problem?
Update 3
A couple of months later. It has happened again. My primary site collection administrator account has lost all the permissions in a random bunch of site collections in a specific web application.
So i cant even access the sites anymore using this account, meaning that the account must have been removed from the owners group as well. This account created the site collections.
Running the PowerShell cmdlt:
get-spsite -WebApplication $w | select url, owner, secondaryContact
returns all the site collections and it shows blank on primary owner and secondary owner in some of the site collections. If i go to Central Admin and go to "Change site collection administrators", the account who lost permissions stands clearly as primary owner of the site, but still has no privileges left.
Entering the account name again does not give me any administrators rights, and in PowerShell it still says blank for primary owner, and i still can't enter the site.
Trying to do it in Powershell using:
Set-SpSite $spSite -owneralias "domain\user" -SecondaryOwnerAlias "<domain\user>"
does not work either.
Any suggestions where i could look? If i can't even do it with PowerShell, then it feels like i can't do it at all.
According to this thread, it's a catch 22 situation.
"It's permissions related. The account I was using to run PowerShell did not have permissions to read content in the problem sites and apparently Owner and SecondaryContact as considered to be content!"
PowerShell SP bug? SPSite.Owner and SPSite.SecondaryContact are Null?
Trying to set all the site collections administrators using PowerShell removes the permissions instead.
Get-SPWebApplication $w | Get-SPSite -Limit All | ForEach-Object { Set-SPSite $_ -OwnerAlias "Domain\Username" -SecondaryOwnerAlias "Domain\Username" }