Error: The Web application at https://sharepoint.sharepointed.com could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application.
I created a .net console app to update some stuff in SharePoint. I received the above error when executing the .exe file with a new service account.
First, I tried granting Shell access to the content db I was working with, but that didn’t solve the problem.
$cDb = Get-SPContentDatabase -site "https://taco.sharepointed.com/" Add-SPShellAdmin -UserName "domain\userAccount -database $cDb
Running the same command without the database switch fixed my problem.
Add-SPShellAdmin -UserName "domain\userAccount"