Home > PowerShell, Tips > How to find the time of remote machine using PowerShell

How to find the time of remote machine using PowerShell

Getting local time using powershell is very easy. You can get it with “Get-Date” cmdlet. But how do you get time of remote machine using PowerShell? You have to rely on WMI objects to get this information.

$rtime = Get-WmiObject -Class Win32_OperatingSytem -ComputerName <yourCompName>

write-host $rtime.ConvertToDateTime($rtime.LocalDateTime)

Let me know if you figureout any other easy way.

No related content found.

  1. March 25, 2010 at 9:02 am | #1

    this is a useful tip on powershell…keep up the good job dude..

  2. March 29, 2010 at 5:45 pm | #2

    Thank you :-)

  1. No trackbacks yet.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>