I'm trying to connect to a Sharepoint Server 2016 and run Sharepoint cmdlets but I am getting an error saying: "Cannot access the local farm. Verify that the local farm is properly configured, currently available, and that you have the appropriate permissions to access the database before trying again". I'm using winrm and connecting from a host that is not a windows machine. When I login to the server directly using the same admin account, my Sharepoint cmdlets work as expected.
It seems this could be related to a "double hop" issue because my SQL server is on a server separate from Sharepoint Server. My servers are azure virtual machines.
I have tried the following and still seeing the error:
Using sharepoint server admin account credentials.
Adding admin user to user groups WSS_ADMIN_WPG, WSS_RESTRICTED_WPG_V4 and WSS_WPG on sharepoint servers local users.
On Sharepoint Server, adding the admin user to shell admins using:
Get-SPDatabase | Add-SPShellAdmin contoso\admin
Ran the following on sharepoint server:
Get-ADComputer -Identity <sharepoint server> | Set-ADAccountControl ‑TrustedForDelegation $true
Added the non-windows hostname I'm connecting from to trusted hosts:
Set-Item WsMan:\localhost\client\trustedhosts -Value "<hostname>" -Concatenate -Force
Added sharepoint server admin account to all roles on SQL Server
Looking for other suggestions that I may have overlooked?