Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista Tutorial - Determine if reboot happened

Reply
 
Old 11-11-2008   #1 (permalink)
Ripp
Guest


 
 

Determine if reboot happened

Hi,

I'm running a script against a number of workstations and some workstations
require a reboot. If i have to execute a reboot what do you guys recommend
in determining if the machine actually took the reboot command? Would like
to know if the reboot actually happened, something i should pull from the
event log? Just looking for some ideas.

Thanks!

My System SpecsSystem Spec
Old 11-11-2008   #2 (permalink)
Ripp
Guest


 
 

RE: Determine if reboot happened

Right now i'm using the following code to issue a reboot:

$workstationObj = Get-WmiObject Win32_OperatingSystem -computer `
workstationID
$workstationObj.Reboot()

But how do i know the actual workstation took the command, or didnt get hung
up on an application or was locked up.

Thanks

"Ripp" wrote:
Quote:

> Hi,
>
> I'm running a script against a number of workstations and some workstations
> require a reboot. If i have to execute a reboot what do you guys recommend
> in determining if the machine actually took the reboot command? Would like
> to know if the reboot actually happened, something i should pull from the
> event log? Just looking for some ideas.
>
> Thanks!
My System SpecsSystem Spec
Old 11-11-2008   #3 (permalink)
Chris
Guest


 
 

Re: Determine if reboot happened

On Nov 11, 10:52*am, Ripp <R...@xxxxxx> wrote:
Quote:

> Right now i'm using the following code to issue a reboot:
>
> $workstationObj = Get-WmiObject Win32_OperatingSystem -computer `
> workstationID
> $workstationObj.Reboot()
>
> But how do i know the actual workstation took the command, or didnt get hung
> up on an application or was locked up.
>
> Thanks
>
> "Ripp" wrote:
Quote:

> > Hi,
>
Quote:

> > I'm running a script against a number of workstations and some workstations
> > require a reboot. *If i have to execute a reboot what do you guys recommend
> > in determining if the machine actually took the reboot command? *Would like
> > to know if the reboot actually happened, something i should pull from the
> > event log? *Just looking for some ideas.
>
Quote:

> > Thanks!

$wmiObject = gwmi Win32_PerfFormattedData_PerfOS_System -ComputerName
$computer

The 'SystemUptime' property will hold the seconds that the PC has been
on since the last reboot or shutdown.
My System SpecsSystem Spec
Old 11-11-2008   #4 (permalink)
Ripp
Guest


 
 

Re: Determine if reboot happened

Thanks! will give it a try

"Chris" wrote:
Quote:

> On Nov 11, 10:52 am, Ripp <R...@xxxxxx> wrote:
Quote:

> > Right now i'm using the following code to issue a reboot:
> >
> > $workstationObj = Get-WmiObject Win32_OperatingSystem -computer `
> > workstationID
> > $workstationObj.Reboot()
> >
> > But how do i know the actual workstation took the command, or didnt get hung
> > up on an application or was locked up.
> >
> > Thanks
> >
> > "Ripp" wrote:
Quote:

> > > Hi,
> >
Quote:

> > > I'm running a script against a number of workstations and some workstations
> > > require a reboot. If i have to execute a reboot what do you guys recommend
> > > in determining if the machine actually took the reboot command? Would like
> > > to know if the reboot actually happened, something i should pull from the
> > > event log? Just looking for some ideas.
> >
Quote:

> > > Thanks!
>
>
> $wmiObject = gwmi Win32_PerfFormattedData_PerfOS_System -ComputerName
> $computer
>
> The 'SystemUptime' property will hold the seconds that the PC has been
> on since the last reboot or shutdown.
>
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
determine app is 32 or 64 bit PowerShell
determine if PC is on a certain network VB Script
Determine PST Format PowerShell
How to determine folder size Vista General
API to determine if UAC is enabled? Vista security


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46