I can't seem to find a way to reboot a remote computer using CIM for a 2008 server. All I have found was Restart-PcsvDevice
but this doesn't work for 2008 servers. Is there a way to use CIM to reboot 2008 servers? I have to use CIM because of the DCOM protocol that is needed for my network.
Asked
Active
Viewed 497 times
0

Ansgar Wiechers
- 193,178
- 25
- 254
- 328

Keith
- 689
- 10
- 27
-
3Have you tried the [Restart-Computer](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/restart-computer?view=powershell-6) cmdlet? – Vivek Kumar Singh Jul 23 '18 at 13:25
-
`Restart-Computer` doesn't offer the use of CIM as far as I can tell. – Keith Jul 23 '18 at 13:35
-
Why does the use of DCOM prevent you from using WinRM as well? – Ansgar Wiechers Jul 23 '18 at 14:44
1 Answers
1
I fail to see why the use of DCOM in your network would prevent you from also using WinRM, but whatever. If you must use WMI/CIM for this you can do so by invoking the Reboot
method of the Win32_OperatingSystem
class on the remote host:
Invoke-CimMethod -Computer someserver -Class Win32_OperatingSystem -Method Reboot
Note that the CIM cmdlets were introduced with PowerShell v3, which does not ship with Windows Server 2008 or 2008 R2, so you may need to use Invoke-WmiMethod
instead, or upgrade to PowerShell v3 or newer.

Ansgar Wiechers
- 193,178
- 25
- 254
- 328