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.

See here (with example)

Hope this helps

Can I have some example please. Thank you.

Registry is not the best solution to my problem cause it only get the data from my local machine.
Is there a way to get the shutdown date from

-Computer Management
-Connect to another computer..
-Type in IP address
and lastly, search for the shutdown logs of the user/s.

I don't know how to code it to web/pc app.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.