I found reboot script at TechNet and I wonder how to apply in VB.Net?
Reboot Coding
************
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate,(Shutdown)}!\ \" & _
strComputer & "\root\cimv2")
Set colOperatingSystems = objWMIService.ExecQuery _
("SELECT * FROM Win32_OperatingSystem")
For Each objOperatingSystem in colOperatingSystems
objOperatingSystem.Reboot()
Next
Questions?
********
- What namespace that I need? System.Management?
- Will this coding work in VB.Net? How? What coding should add?
- Will it work at Windows Server 2003?
I need to reboot Windows Server 2003 to clear web cache and SQL cache for
better memory management.
Please advise.
Many thanks.