I was installing a new SharePoint Server 2019 farm and after applying all updates and configuring the SharePoint Products Wizard, I restarted my servers a final time and logged on, only to find that I couldn’t access the SharePoint Products Wizard anymore.
I was receiving an “Access Denied” error when trying to connect to the SharePoint Configuration Database. After scratching my head for a while, I realized I had added a local account to the Farm Administrator instead of my domain account.

Fortunately, there was a reasonably easy fix. We’ve got it documented at https://docs.microsoft.com/en-us/powershell/module/sharepoint-server/add-spshelladmin?view=sharepoint-ps, but of course, there’s stuff that we leave out. This is how I solved that problem.
- Launch SharePoint Management Shell using RunAs Other User and enter the credentials of a current farm administrator (in this case, my local account).
- Copy/paste this bad boy:
Function New-FarmAdmin ([string]$Identity,[switch]$IncludeAllContentDatabases) { $CentralAdminWebApp = Get-SPWebApplication –IncludeCentralAdministration | ? {$_.DisplayName –like "SharePoint Central Administration*"} New-SPUser –UserAlias $Identity –Web $CentralAdminWebApp.URL –Group "Farm Administrators" $CentralAdminContentDB = Get-SPContentDatabase –WebApplication $CentralAdminWebApp Add-SPShellAdmin -Database $CentralAdminContentDB -Username $Identity If ($IncludeAllContentDatabases) { $ContentDatabases = Get-SPContentDatabase Foreach ($Database in $ContentDatabases) { Add-SPShellAdmin -Database $Database -Username $Identity } } } - Run
New-FarmAdmin -Identity <DOMAIN\Username> -IncludeAllContentDatabases - Celebrate. Beer optional.
Happy Farming!

