Managing remote windows box

by Grzegorz Kulikowski

I will have this 1 post for all useful commands.

Rebooting remote windows box

(gwmi win32_operatingsystem -Computername XXXXXXX -cred (get-credential)).Win32Shutdown(6)

Please check also http://msdn.microsoft.com/en-us/library/windows/desktop/aa394058%28v=vs.85%29.aspx to see possible flags you can set for the reboot.

Checking uptime of a remote windows box, for example after the reboot

[Management.ManagementDateTimeConverter]::ToDateTime((Get-WmiObject Win32_OperatingSystem -Computername XXXXXX -cred (get-credential)).LastBootUpTime)

Checking network configuration of a remote windows box

Get-WmiObject -Class Win32_NetworkAdapterConfiguration -Filter IPEnabled=TRUE -ComputerName XXXXXX –Cred  (get-credential) | select IPSubnet,DefaultIPGateway,WINSPrimaryServer,WINSSecondaryServer,IPAddress,DNSServerSearchOrder

I will try to update this post each time i find something useful.

You may also like

Leave a Reply

Chinese (Simplified)EnglishFrenchGermanHindiPolishSpanish