I've tried to run the script UpdateOS on a remote server, but always get error code 0x80070005 is also described as ACCESS DENIED. Tried below and same error.
Invoke-Command -ComputerName RemoteComputerName -FilePath "C:\Path\To\Update.ps1"
tried pSSession as well when logged on using Domain admin account: #Server name
$serverName = "Server1"
#Establish Session
$session = New-PSSession -ComputerName $serverName
#Run updateOS
Invoke-Command -Session $session -FilePath "C:\Path\To\Update.ps1"