Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > PowerShell

Install a Windows Patch to Remote Vista Machine?

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 03-16-2008   #1 (permalink)
Gerry Hickman
Guest


 

Install a Windows Patch to Remote Vista Machine?

Hi,

Sometimes we have to get "hotfixes" from Microsoft that are not part of
the usual Windows Update cycle. I'd like to programatically roll them
out (and roll them back) on specific machines.

On a local machine, you can scan the machine, then call the download and
install methods for a specific patch, but this doesn't work on a remote
machine (using COM). It can be done with PsExec, but it's messy. Can it
be done in PowerShell?

--
Gerry Hickman (London UK)

My System SpecsSystem Spec
Old 03-16-2008   #2 (permalink)
RichS
Guest


 

RE: Install a Windows Patch to Remote Vista Machine?

You may be able to do it WMI - need to dig into it. Otherwise have a look at
the SpecOps Command product - I think there is a free version that may do
what you want
--
Richard Siddaway
Please note that all scripts are supplied "as is" and with no warranty
Blog: http://richardsiddaway.spaces.live.com/
PowerShell User Group: http://www.get-psuguk.org.uk


"Gerry Hickman" wrote:
Quote:

> Hi,
>
> Sometimes we have to get "hotfixes" from Microsoft that are not part of
> the usual Windows Update cycle. I'd like to programatically roll them
> out (and roll them back) on specific machines.
>
> On a local machine, you can scan the machine, then call the download and
> install methods for a specific patch, but this doesn't work on a remote
> machine (using COM). It can be done with PsExec, but it's messy. Can it
> be done in PowerShell?
>
> --
> Gerry Hickman (London UK)
>
My System SpecsSystem Spec
Old 03-16-2008   #3 (permalink)
Gerry Hickman
Guest


 

Re: Install a Windows Patch to Remote Vista Machine?

Hi Rich,

I'm asking how to do it with PowerShell!

Regarding "doing it with WMI" can you be more specific, how would I get
the return values, reboot status etc? Regarding SpecOps, I'm asking
about how to do it with Microsoft tools and technologies; the o/s and
patch are BOTH Microsoft, I should not need some 3rd party add-on.

RichS wrote:
Quote:

> You may be able to do it WMI - need to dig into it. Otherwise have a look at
> the SpecOps Command product - I think there is a free version that may do
> what you want

--
Gerry Hickman (London UK)
My System SpecsSystem Spec
Old 03-16-2008   #4 (permalink)
Marco Shaw [MVP]
Guest


 

Re: Install a Windows Patch to Remote Vista Machine?

> On a local machine, you can scan the machine, then call the download and
Quote:

> install methods for a specific patch, but this doesn't work on a remote
> machine (using COM). It can be done with PsExec, but it's messy. Can it
> be done in PowerShell?
Perhaps I've been away from sys admin too long. Are you doing all of
this from the command-line? Can you provide more details?

You seem to dislike winrm which would help with remote "COM'ing" indirectly.

Marco
My System SpecsSystem Spec
Old 03-17-2008   #5 (permalink)
Gerry Hickman
Guest


 

Re: Install a Windows Patch to Remote Vista Machine?

Hi Marco,

Yes, you can do it from a command line. e.g. for patches that are
already on WU/MU: Using JScript you can instantiate the Windows Update
COM objects, you then scan the machine, filter the patch collection
based on the patch you want to apply, then call the Download and Install
methods, you can trap errors, check for reboot. Once you have the
JScript, you can remote it using PsExec.

My question is, how do you do this the "new way", as in PowerShell,
..NET, etc.

Marco Shaw [MVP] wrote:
Quote:
Quote:

>> On a local machine, you can scan the machine, then call the download
>> and install methods for a specific patch, but this doesn't work on a
>> remote machine (using COM). It can be done with PsExec, but it's
>> messy. Can it be done in PowerShell?
>
> Perhaps I've been away from sys admin too long. Are you doing all of
> this from the command-line? Can you provide more details?
>
> You seem to dislike winrm which would help with remote "COM'ing"
> indirectly.
>
> Marco

--
Gerry Hickman (London UK)
My System SpecsSystem Spec
Old 03-17-2008   #6 (permalink)
Marco Shaw [MVP]
Guest


 

Re: Install a Windows Patch to Remote Vista Machine?

Gerry Hickman wrote:
Quote:

> Hi Marco,
>
> Yes, you can do it from a command line. e.g. for patches that are
> already on WU/MU: Using JScript you can instantiate the Windows Update
> COM objects, you then scan the machine, filter the patch collection
> based on the patch you want to apply, then call the Download and Install
> methods, you can trap errors, check for reboot. Once you have the
> JScript, you can remote it using PsExec.
>
> My question is, how do you do this the "new way", as in PowerShell,
> .NET, etc.
Interesting...

PSH> $wu=new-object -comobject microsoft.update.autoupdate
PSH> $wu|get-member


TypeName: System.__ComObject#{4a2f5c31-cfd9-410e-b7fb-29a653973a0f}

Name MemberType Definition
---- ---------- ----------
DetectNow Method void DetectNow ()
EnableService Method void EnableService ()
Pause Method void Pause ()
Resume Method void Resume ()
ShowSettingsDialog Method void ShowSettingsDialog ()
Results Property IAutomaticUpdatesResults Results () {get}
ServiceEnabled Property bool ServiceEnabled () {get}
Settings Property IAutomaticUpdatesSettings Settings () {get}

Now, you're using COM still. Unless there's a .NET library for this,
and I'd doubt it, this is the easiest way to access WU from PowerShell
very likely.

Not a fault of PowerShell if WU doesn't have other interfaces...

Marco
My System SpecsSystem Spec
Old 03-17-2008   #7 (permalink)
Marco Shaw [MVP]
Guest


 

Re: Install a Windows Patch to Remote Vista Machine?

Quote:
Quote:

>> My question is, how do you do this the "new way", as in PowerShell,
>> .NET, etc.
>
> Interesting...
>
> PSH> $wu=new-object -comobject microsoft.update.autoupdate
> PSH> $wu|get-member
It appears the WSUS *server* has a class library (written in .NET).
That class library would likely work very well if called from
PowerShell, but I can't tell you what kind of functionality it would
offer you.

Marco
My System SpecsSystem Spec
Old 03-17-2008   #8 (permalink)
Gerry Hickman
Guest


 

Re: Install a Windows Patch to Remote Vista Machine?

Hi Marco,

OK, at last we're getting some sensible answers!
Quote:
Quote:

>> My question is, how do you do this the "new way", as in PowerShell,
>> .NET, etc.
>
> Interesting...
>
> PSH> $wu=new-object -comobject microsoft.update.autoupdate
> PSH> $wu|get-member
>
>
> TypeName: System.__ComObject#{4a2f5c31-cfd9-410e-b7fb-29a653973a0f}
>
> Name MemberType Definition
> ---- ---------- ----------
> DetectNow Method void DetectNow ()
> EnableService Method void EnableService ()
> Pause Method void Pause ()
> Resume Method void Resume ()
> ShowSettingsDialog Method void ShowSettingsDialog ()
> Results Property IAutomaticUpdatesResults Results () {get}
> ServiceEnabled Property bool ServiceEnabled () {get}
> Settings Property IAutomaticUpdatesSettings Settings () {get}
>
> Now, you're using COM still. Unless there's a .NET library for this,
> and I'd doubt it, this is the easiest way to access WU from PowerShell
> very likely.
>
> Not a fault of PowerShell if WU doesn't have other interfaces...
It's the fault of Microsoft for not supplying them.

--
Gerry Hickman (London UK)
My System SpecsSystem Spec
Old 03-17-2008   #9 (permalink)
Gerry Hickman
Guest


 

Re: Install a Windows Patch to Remote Vista Machine?

Hi Marco,
Quote:
Quote:

>> PSH> $wu=new-object -comobject microsoft.update.autoupdate
>> PSH> $wu|get-member
>
> It appears the WSUS *server* has a class library (written in .NET). That
> class library would likely work very well if called from PowerShell, but
> I can't tell you what kind of functionality it would offer you.
Yup, good observation, but WSUS is actually not very useful in this
case. The "power" is in the client tools, plus in our case we don't run
WSUS

--
Gerry Hickman (London UK)
My System SpecsSystem Spec
Old 03-17-2008   #10 (permalink)
Gerry Hickman
Guest


 

Re: Install a Windows Patch to Remote Vista Machine?

Hi Marco,
Quote:
Quote:

>> PSH> $wu=new-object -comobject microsoft.update.autoupdate
>> PSH> $wu|get-member
Yup, so much for .NET when you need to do anything useful. It's "Back to
COM" as always.

--
Gerry Hickman (London UK)
My System SpecsSystem Spec
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
Windows Vista machine asking to install Windows XP Service Pack 3 ukhuman1st Vista General 2 06-10-2008 01:25 PM
checked for logged on user on remote machine + remote reboot Ben Christian PowerShell 2 03-10-2008 06:52 PM
I am not able to login to my Windows Visa machine using Remote Desktop it shows the network connections as local how to change this settings jack Vista performance & maintenance 1 07-30-2007 09:44 PM
Remote Login on Windows Vista Machine Pavan Vista account administration 1 04-30-2007 02:21 PM
Does anyone know a patch to support NLA in Remote Desktop Client 6 Angel Vista networking & sharing 7 03-29-2007 04:51 AM


Update your Vista Drivers Update Your Vista Drivers Now!!

Vistax64.com 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 2005-2008