Announcement

Collapse
No announcement yet.

Sever restart Date

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Sever restart Date

    Dear allis there any way we can find when server was last restartedis there any logs will be generated in the event viewer or any tool available to monitor thisKindly give your valuable suggestion

  • #2
    Re: Sever restart Date

    start > run > CMD
    net statistics workstation
    "...if I turn out to be particularly clear, you've probably misunderstood what I've said” - Alan Greenspan

    Comment


    • #3
      Re: Sever restart Date

      i have tried the following cmdshere is the resultsC:\Documents and Settings\%admin!!!>net statistics workstationWorkstation Statistics for \\IBANK27Statistics since 9/10/2008 5:03 PM Bytes received 11175581 Server Message Blocks (SMBs) received 10105 Bytes transmitted 2352025 Server Message Blocks (SMBs) transmitted 10085 Read operations 1713 Write operations 24 Raw reads denied 0 Raw writes denied 0 Network errors 0 Connections made 11 Reconnections made 0 Server disconnects 8 Sessions started 0 Hung sessions 0 Failed sessions 0 Failed operations 9 Use count 17 Failed use count 3The command completed successfully.C:\Documents and Settings\%admin!!!>net statistics serverServer Statistics for \\IBANK27Statistics since 9/10/2008 5:03 PMSessions accepted 1Sessions timed-out 9Sessions errored-out 9Kilobytes sent 15785Kilobytes received 1245Mean response time (msec) 0System errors 0Permission violations 0Password violations 0Files accessed 1812Communication devices accessed 0Print jobs spooled 0Times buffers exhausted Big buffers 0 Request buffers 0The command completed successfully.C:\Documents and Settings\%admin!!!>where to find the restart date in the cmdPls help

      Comment


      • #4
        Re: Sever restart Date

        I just tried this on a workstation and on a server but could not see any information about when the machine was last restarted.

        Look for eventlog 6005 in the System Event Log. This tells you when the event log service was started which takes place when the OS starts.
        A recent poll suggests that 6 out of 7 dwarfs are not happy

        Comment


        • #5
          Re: Sever restart Date

          Originally posted by Blood View Post
          I just tried this on a workstation and on a server but could not see any information about when the machine was last restarted.
          determine last boot/reboot time via the command line:

          Start / Run:
          Code:
          cmd /k (cls&echo.&net statistics workstation |Find/i "Statistics since"&echo.(=last boot time!)
          or,
          Start / Run:
          Code:
          cmd /k wmic /node:%Computername% OS Get LastBootUpTime /format:list
          \Rems

          This posting is provided "AS IS" with no warranties, and confers no rights.

          __________________

          ** Remember to give credit where credit's due **
          and leave Reputation Points for meaningful posts

          Comment


          • #6
            Re: Sever restart Date

            Thanks a lot Rems

            When I try the second one I get:

            Node - %blood%
            ERROR:
            Code = 0x800706ba
            Description = The RPC server is unavailable.
            Facility = Win32

            I also get it for any other PC. Anyone have any ideas why this may be happening, please?

            The first one works great - "statistics since..."
            Last edited by Blood; 12th September 2008, 13:49. Reason: clarity
            A recent poll suggests that 6 out of 7 dwarfs are not happy

            Comment


            • #7
              Re: Sever restart Date

              Originally posted by balajitry View Post
              i have tried the following cmdshere is the resultsC:\Documents and Settings\%admin!!!>net statistics workstationWorkstation Statistics for \\IBANK27Statistics since 9/10/2008 5:03 PM Bytes received 11175581 Server Message Blocks (SMBs) received 10105 Bytes transmitted 2352025 Server Message Blocks (SMBs) transmitted 10085 Read operations 1713 Write operations 24 Raw reads denied 0 Raw writes denied 0 Network errors 0 Connections made 11 Reconnections made 0 Server disconnects 8 Sessions started 0 Hung sessions 0 Failed sessions 0 Failed operations 9 Use count 17 Failed use count 3The command completed successfully.C:\Documents and Settings\%admin!!!>net statistics serverServer Statistics for \\IBANK27Statistics since 9/10/2008 5:03 PMSessions accepted 1Sessions timed-out 9Sessions errored-out 9Kilobytes sent 15785Kilobytes received 1245Mean response time (msec) 0System errors 0Permission violations 0Password violations 0Files accessed 1812Communication devices accessed 0Print jobs spooled 0Times buffers exhausted Big buffers 0 Request buffers 0The command completed successfully.C:\Documents and Settings\%admin!!!>where to find the restart date in the cmdPls help
              Looks like it worked for you...see the very first line.
              "...if I turn out to be particularly clear, you've probably misunderstood what I've said” - Alan Greenspan

              Comment


              • #8
                Re: Sever restart Date

                WMIC.exe is only available on Windows XP and Server 2003 (and newer).
                In the sample, %computername% is a system variable, it will echo the computername. If you want to enter a computer name, then type the name of the local or remote computer w/out the percent signs.

                (Blood, mind backtalk discussions in the thread a bit. Wait for the Original Poster comment to the replies. Otherwise it might starting to look like you hijacking the thread)


                Originally posted by Blood View Post
                Look for eventlog 6005 in the System Event Log. This tells you when the event log service was started which takes place when the OS starts.
                Excellent idea, lets find out if this can be done with a one liner too :
                Start / Run:
                Code:
                cmd /k For /f "tokens=1,2*" %a in ('WMIC NTEVENT WHERE "EventType=3 AND EventCode>6004 AND EventCode<6009" GET EventCode^, TimeGenerated') do @((If [%a]==[6005] echo.Boot = %b)&(If [%a]==[6006] echo.Shutdown = %b)&(If [%a]==[6008] echo.Shutdwn! = %b))
                It is better to run that WMIC command in a batch, like
                Code:
                :: EDIT 1, added the LogFile-name to the search filter,this will make the batch run much faster
                
                @echo off
                setLocal EnableDelayedExpansion
                title Sytem boot history
                color 6A
                
                Set "log='System'"
                (Set strCMD='WMIC.exe NTEVENT WHERE "LogFile=%log% AND EventType=3 AND EventCode>6004 AND EventCode<6009" GET EventCode^^, TimeGenerated')
                echo.Latest events first...
                echo.(times are being displayed according the dls and zone settings on the computer)
                echo.
                
                For /f "tokens=1,2*" %%a in (%strCMD%) do (
                   Set "dt=%%b"
                   (Set YY=!dt:~0,4!&Set MM=!dt:~4,2!&Set DD=!dt:~6,2!)
                   (Set HH=!dt:~8,2!&Set NN=!dt:~10,2!&Set SS=!dt:~12,2!&Set Bias=!dt:~21!)
                   (If [%%a]==[6005] echo.Boot			= !YY!-!MM!-!DD! !HH!:!NN!:!SS!  (=UTC!Bias! Minutes^))
                   (If [%%a]==[6006] echo.Shutdown		= !YY!-!MM!-!DD! !HH!:!NN!:!SS!  (=UTC!Bias! Minutes^))
                   (If [%%a]==[6008] echo.Shutdown (dirty^)	= !YY!-!MM!-!DD! !HH!:!NN!:!SS!  (=UTC!Bias! Minutes^))
                )
                
                pause>nul
                (I left out the /node:%Computername% in the command, now the command will run automatically against the local computer)


                \Rems
                Last edited by Rems; 12th September 2008, 21:54. Reason: added the LogFile-name to the filter in the batch to speed up the batch

                This posting is provided "AS IS" with no warranties, and confers no rights.

                __________________

                ** Remember to give credit where credit's due **
                and leave Reputation Points for meaningful posts

                Comment


                • #9
                  Re: Sever restart Date

                  Here is what i use every week to investigate server reboot times.
                  got to Microsoft and download UPTIME>EXE @ http://support.microsoft.com/kb/232243
                  it will either run on the local system or a remote system if you have the needed access.
                  Redearl
                  Congress is like diapers; It should be changed regularly as it gets full of the same thing..

                  Comment


                  • #10
                    Re: Sever restart Date

                    Sorry LOIR_Sfor my carelessness. i did not see the report carefullynow i have tested it again by restartng my PCthanks for the helpAny how i came to know the other alternate methods of knowing the uptimeI will also try the link suggested by redearlthanks all

                    Comment


                    • #11
                      Re: Sever restart Date

                      Originally posted by redearl View Post
                      Here is what i use every week to investigate server reboot times.
                      got to Microsoft and download UPTIME>EXE @ http://support.microsoft.com/kb/232243
                      it will either run on the local system or a remote system if you have the needed access.
                      Uptime.exe used with the /s switch will also show the same shutdown and boot times as the batch do in my previous reply.
                      But, running Uptime.exe with the switch on windows server 2003 will end in an error on my sytems (unlike te batch).
                      You can call uptime.exe from within the batch to show just the uptime and the batch for boot times. Or use vbs.

                      \Rems

                      Similar Threads
                      - Last Reboot Time !
                      - Script to determine windows uptime
                      ,
                      Last edited by Rems; 13th September 2008, 10:33.

                      This posting is provided "AS IS" with no warranties, and confers no rights.

                      __________________

                      ** Remember to give credit where credit's due **
                      and leave Reputation Points for meaningful posts

                      Comment


                      • #12
                        Re: Sever restart Date

                        Originally posted by Rems View Post

                        (Blood, mind backtalk discussions in the thread a bit. Wait for the Original Poster comment to the replies. Otherwise it might starting to look like you hijacking the thread)
                        Apologies - Point taken.


                        Thanks for the help. I'll give this a go when I'm back at work. Scripts have never been my thing - old DOS batch files: Fine. VBS, PowerShell etc: Brain dribbles from ears.

                        Cheers!

                        Edit:

                        D'oh! I can't believe I left the quotes in. Works fine
                        Last edited by Blood; 16th September 2008, 13:48.
                        A recent poll suggests that 6 out of 7 dwarfs are not happy

                        Comment


                        • #13
                          Re: Sever restart Date

                          here is another link in which we can find the detailshttp://www.winhelponline.com/blog/how-to-determine-the-last-shutdown-date-and-time-in-windows-xp2003vista/

                          Comment

                          Working...
                          X