I'm trying to update a site collection's owner and secondary with PowerShell. Currently, they're blank and CA fails. I enter the following in PowerShell:
Get-SPSite "http://company/division/site" | %{Set-SPSite $_ -OwnerAlias "spadmin" -SecondaryOwnerAlias "altspadmin"}
The following error is returned:
Set-SPSite : At line:11 char:46
+ Get-SPSite "http://company/division/site" | %{Set-SPSite $_ -OwnerAlias "spadmin ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (Microsoft.Share...SPCmdletSetSite:SPCmdletSetSite) [Set-SPSite], SPException
+ FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletSetSite
(The highlight is under the Set-SPSite command.) The names are valid. Even the domain\name fails.
Note: I don't know if this has something to do with the error, but I notice that the content db is missing the SPDataAccess and SPReadOnly. Do you know how to get these roles installed?
Get-SPSite "http://company/division/site" | %{Set-SPSite $_ -OwnerAlias "spadmin"
so Could you please try this commandSet-SPSite -Identity "<SiteCollection>" -SecondaryOwnerAlias "<domain>\<username>"
and check if you face the same issue or not!i:0#.w|Domain\Username
?