I am using SP2013 onpremises. I'm using an account which is a Farm administrator and a Shell Administrator and a local admin on the SP Server.
I am running a Set-SPUser command and receiving the 'Cannot find an SPWeb object with Id or Url: ". The URL is correct. I'm able to navigate to it with the account I'm executing the command with.
Set-SPUser -Identity $User -Web $spsite -email $email -SyncFromAD
where: $User contains the domain\username (no claims identifier)
$spsite contains the FQDN to the site with no trailing slash or spaces.
$email is the users's properly formatted email address.
I should not that this is happening with a specific URL. I'm able to get the spweb to a site that was setup earlier. We use host named site collections on our farm.