Welcome to ServerForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Restart Pending

 
   Windows Server (Home) -> Windows Server Scripting RSS
Next:  Passing a Monad (powershell) variable as command ..  
Author Message
Brad McDonald

External


Since: May 08, 2006
Posts: 4



(Msg. 1) Posted: Mon Jun 05, 2006 4:47 pm
Post subject: Restart Pending
Archived from groups: microsoft>public>windows>server>scripting (more info?)

Hello,

Has anyone come up with a WMI query that determines if a system has a
pending restart waiting in the wings, following Windows Update?

I know the CreateObject("Microsoft.Update.SystemInfo"), but I'm looking to
query these systems remotely.

Thanks
Brad

 >> Stay informed about: Restart Pending 
Back to top
Login to vote
J Ford

External


Since: Jan 12, 2005
Posts: 54



(Msg. 2) Posted: Tue Jun 06, 2006 6:51 am
Post subject: RE: Restart Pending [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

There are quite a few cmd utils to detect it; however if you want to WMI
script it you can use WMI to check for the existence of
"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session
Manager\PendingFileRenameOperations" which I believe is a REG_MULTI_SZ

Which is what most of the cmd utils check to see if a reboot is
pending/needed.

Perhaps...
<script>
On Error Resume Next

Const HKEY_LOCAL_MACHINE = &H80000002
Const REG_MULTI_SZ = 7

strComputer = "."

Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
strComputer & "\root\default:StdRegProv")

strKeyPath = "SYSTEM\CurrentControlSet\Control\Session Manager"
strValueName = "PendingFileRenameOperations"

oReg.GetMultiStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,arrValues

If Not IsNull(arrValues) Then
For Each strValue In arrValues
Wscript.Echo strValue
Next
Else
Wscript.Echo "No Pending Reboot"
End If

</script>


"Brad McDonald" wrote:

> Hello,
>
> Has anyone come up with a WMI query that determines if a system has a
> pending restart waiting in the wings, following Windows Update?
>
> I know the CreateObject("Microsoft.Update.SystemInfo"), but I'm looking to
> query these systems remotely.
>
> Thanks
> Brad

 >> Stay informed about: Restart Pending 
Back to top
Login to vote
jrvilda

External


Since: Feb 12, 2007
Posts: 1



(Msg. 3) Posted: Mon Feb 12, 2007 4:15 pm
Post subject: RE: Restart Pending [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

¿porque en windows 2000 no funciona?
solo sale 1 path, y segun el registro hay varios.



"J Ford" wrote:

> There are quite a few cmd utils to detect it; however if you want to WMI
> script it you can use WMI to check for the existence of
> "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session
> Manager\PendingFileRenameOperations" which I believe is a REG_MULTI_SZ
>
> Which is what most of the cmd utils check to see if a reboot is
> pending/needed.
>
> Perhaps...
> <script>
> On Error Resume Next
>
> Const HKEY_LOCAL_MACHINE = &H80000002
> Const REG_MULTI_SZ = 7
>
> strComputer = "."
>
> Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
> strComputer & "\root\default:StdRegProv")
>
> strKeyPath = "SYSTEM\CurrentControlSet\Control\Session Manager"
> strValueName = "PendingFileRenameOperations"
>
> oReg.GetMultiStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,arrValues
>
> If Not IsNull(arrValues) Then
> For Each strValue In arrValues
> Wscript.Echo strValue
> Next
> Else
> Wscript.Echo "No Pending Reboot"
> End If
>
> </script>
>
>
> "Brad McDonald" wrote:
>
> > Hello,
> >
> > Has anyone come up with a WMI query that determines if a system has a
> > pending restart waiting in the wings, following Windows Update?
> >
> > I know the CreateObject("Microsoft.Update.SystemInfo"), but I'm looking to
> > query these systems remotely.
> >
> > Thanks
> > Brad
 >> Stay informed about: Restart Pending 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Restart with VBS - hello, i have a problem to do a vbs scrpit who can reboot my machine. I have make a script like that: Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate,(Shutdown)}!\\" ) Set colOperatingSystems = ob...

restart computer - Can this script reboot computer across subnet? strComputer = inputbox"Enter PC name" Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate,(Shutdown)}!\\" & strComputer & "\root\ci...

restart computer - hello, anyone have any idea why i get this error when i try run this vbs? this script allow restart a computer strComputer = "computer" Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate,(Shutdown...

restart error - Does anyone know anything about how to solve this problem? THE DRIVE OR NETWORK CONNECTION THAT THE SHROTCUT 'RESTART_VS.INK' REFERS TO IS UNAVAILABLE. MAKE SURE THAT THE DISK IS PROPERLY INSERTED OR THE NETWORK RESOURCE IS AVILABLE, AND THEN TRY....

What is outlook restart? - Hi all, When the exchange goes down and if any other server starts functioning,my outlook 2003 asks for outlook restart. My outlook is in cached mode. When i am trying to send data and if the connection is lost it asks for outlook 2003.If i ignore,the...
   Windows Server (Home) -> Windows Server Scripting All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]