Hi,
I would like to know how to view shutdowntime from another IP address.
I only know how to view it from my localmachine. This is my code:
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Label1.Text = GetLastSystemShutdown().ToString()
End Sub
Public Shared Function GetLastSystemShutdown() As DateTime
Dim sKey As String = "System\CurrentControlSet\Control\Windows"
Dim key As Microsoft.Win32.RegistryKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(sKey)
Dim sValueName As String = "ShutdownTime"
Dim val As Byte() = DirectCast(key.GetValue(sValueName), Byte())
Dim valueAsLong As Long = BitConverter.ToInt64(val, 0)
Return DateTime.FromFileTime(valueAsLong)
End Function
Output:
Address: ###.##.##.##
Shutdown date and time: 3/14/2013 6:04:28 PM
I don't have any idea on how to put the IP address, I need to view it's shutdown logs.
Thank you in advance.