I am running a remote powershell script which attempts to setup a web-application and site collection and then attempts to add a user to that site collection.
I receive the following error:
New-SPUser : Access is denied. (Exception from HRESULT: 0x80070005)
This does not occur if I run the same script locally with the same administrative account.