1

I am trying to verify that the usbstor driver is set to disabled on a remote machine in my domain in a vbscript but I'm having issues. I've turned to troubleshooting from the command line.

Using plain old reg query fails.

reg query \\hostname\hklm\system\currentcontrolset\services\usbstor /v start
ERROR: The network path was not found.

But if I run essentially the same command with winrs, it works fine.

winrs -r:hostname reg query hklm\system\currentcontrolset\services\usbstor /v start

HKEY_LOCAL_MACHINE\system\currentcontrolset\services\usbstor
    start    REG_DWORD    0x4

Both commands work fine on other computers. What gives with this one?

Regardless of the computer I'm running the commands against, I open the firewall with this command:

winrs -r:hostname netsh advfirewall firewall set rule 
   group="Windows Management Instrumentation (WMI)" new enable=yes
4

1 回答 1

1

该服务RemoteRegistry未在远程主机上运行(或不可访问)。您应该能够像这样启动它:

sc \\hostname config RemoteRegistry start= auto
sc \\hostname start RemoteRegistry

如果服务正在运行但仍无法访问,请检查 Windows 防火墙是否允许 RPC

于 2015-11-04T11:27:22.047 回答