cscript error Access is Denied


i have ps script runs invokes vbs script. works fine until try include -computername attribute. when access denied error.

script: 

$computername = read-host "computer name: " $employeecode = read-host "employee code: "  invoke-command -scriptblock { cscript.exe \\serverpath\userprintersscrape.vbs $computername $employeecode } -computername $computername

when run it, error: 

cscript error: loading script "\\serverpath\userprintersscrape.vbs" failed (access denied. ).

however if run runs fine:

$computername = read-host "computer name: " $employeecode = read-host "employee code: "  invoke-command -scriptblock { cscript.exe \\serverpath\userprintersscrape.vbs $computername $employeecode }

the problem is, need run on remote pc. thoughts on how resolve or causing it?

edit: 1 other thing note, when add -computername run on local pc testing , error.

second hop restriction.  up.


\_(ツ)_/



Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

DCOM received error "2147746132" from...

DFSR RPC replication errors 5014 1726 with large files over VPN

ADFS 3.0 Event ID 4625 | An Error occurred During Logon | Status: 0xC000035B