How to shutdown remote Win2k8 machine using WMIC?

0

What is the exact syntax to shutdown remote Win2k8 server using WMIC?

(The reason WMIC must be used is because the remote machine in a different NT Domain and the local machine does not have access to that domain. WMIC takes /user: and /password: parameters and auths against remote machine itself.)

These don't work:

wmic /node:10.162.x.x /user:tech1\xxxx /password:xxxx os call Shutdown

Executing (Win32_OperatingSystem)->Shutdown()

ERROR: Code = 0x8004102f Description = Invalid method Parameter(s)

Facility = WMI


wmic /node:10.162.x.x /user:tech1\xxxx /password:xxxx os call Shutdown(1)

Verb Or Method has no input parameters.


wmic /node:10.162.x.x /user:tech1\xxxx /password:xxxx os call Win32Shutdown(1)

Executing (Win32_OperatingSystem)->Win32Shutdown()

ERROR:

Code = 0x8004102f

Description = Invalid method Parameter(s)

Facility = WMI


wmic /node:10.162.x.x /user:tech1\xxxx /password:xxxx path Win32_OperatingSystem call Shutdown(1)

Verb Or Method has no input parameters.


wmic /node:10.162.x.x /user:tech1\xxxx /password:xxxx path Win32_OperatingSystem call Shutdown

Executing (Win32_OperatingSystem)->Shutdown()

ERROR: Code = 0x8004102f Description = Invalid method Parameter(s) Facility = WMI

windows
windows-server-2008
remote-access
wmi
asked on Server Fault Jun 28, 2010 by zvolkov • edited Jun 11, 2020 by Community

4 Answers

2

I don't know why WMIC wont work, but the powershell version does work:

$cred = get-credential tech1\xxxxx
(gwmi -comp 10.162.x.x -cred $cred Win32_OperatingSystem).Shutdown()

You'll be prompted for the password, there's no way around it prompting you for the password.

answered on Server Fault Jun 29, 2010 by Chris S
1

the 1st one but you need a space between the ipaddress and the /user:

add a where clause

something like

wmic os where "version like '%'" call win32shutdown 2

answered on Server Fault Jun 28, 2010 by tony roth • edited Jun 29, 2010 by tony roth
1
wmic /node: "machinename" os where primary="true" call shutdown

Must have space after : Must have quotes around machinename and true

use /user:username between machinename and os if you need to authenticate

answered on Server Fault May 7, 2013 by Allen • edited May 7, 2013 by Stephane
0

Try this

WMIC /node:COMPUTER process call create “cmd.exe /c shutdown”
answered on Server Fault May 6, 2019 by Cédric Jäggi • edited May 6, 2019 by womble

User contributions licensed under CC BY-SA 3.0