I have a VBS Script located on a Network Share in the same Domain. It’s function to uninstall all versions of Java it detects through a WMI Query,
I want every computer in an OU to call the VB Script, so am using invoke-command with the Scriptblock parameter. However after loading cscript, Powershell then reports cscript error loading script “scriptpath” failed (Access is Denied). I have also tried enter-pssession and called the script from the remote computers prompt, with the same result.
I am running the console as Administrator, and when I run the script locally the script runs successfully.
Reading other forums it has been suggested, problem could be the Double Hop in that it is not using the same credentials I open the console with. (ie no permissions to share drive) I have tried running the command with Credentials as well.
Trial and error is failing, I need to be pointed in the right direction…