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 - How to check service packs on remote computers.

Reply
 
Old 04-12-2007   #1 (permalink)
Damon


 
 

How to check service packs on remote computers.

Hello,
I am wanting to write a script that will take a list of server names and
return the OS and service pack level.
I have written
$ser= get-Content c:\wmi\servers.txt
Get-WmiObject win32_osrecoveryconfiguration -computername $ser |
Format-Table __server, name
This gives a list of the server and the OS but not the Service Pack level.

Thanks for any help

My System SpecsSystem Spec
Old 04-12-2007   #2 (permalink)
Brandon Shell


 
 

Re: How to check service packs on remote computers.

$ser= get-Content c:\wmi\servers.txt

foreach($s in $ser)
{
$ServicePack = Get-WmiObject Win32_OperatingSystem -ComputerName $s
$ServicePack = $ServicePack.ServicePackMajorVersion
Write-Host "Server [$s] has SP [$ServicePack]"
}

--
Brandon Shell
---------------
Stop by my blog some time
Blog: http://www.bsonposh.com/
PSH Scripts Project: www.codeplex.com/psobject
--------------------------------------

"Damon" <Damon@discussions.microsoft.com> wrote in message
news:94E0DBA1-DABC-4A67-BC78-2BDC36FAF548@microsoft.com...
> Hello,
> I am wanting to write a script that will take a list of server names and
> return the OS and service pack level.
> I have written
> $ser= get-Content c:\wmi\servers.txt
> Get-WmiObject win32_osrecoveryconfiguration -computername $ser |
> Format-Table __server, name
> This gives a list of the server and the OS but not the Service Pack level.
>
> Thanks for any help


My System SpecsSystem Spec
Old 04-12-2007   #3 (permalink)
Xsh3ll


 
 

Re: How to check service packs on remote computers.

gwmi win32_operatingsystem | select service*


"Damon" <Damon@discussions.microsoft.com> wrote in message
news:94E0DBA1-DABC-4A67-BC78-2BDC36FAF548@microsoft.com...
> Hello,
> I am wanting to write a script that will take a list of server names and
> return the OS and service pack level.
> I have written
> $ser= get-Content c:\wmi\servers.txt
> Get-WmiObject win32_osrecoveryconfiguration -computername $ser |
> Format-Table __server, name
> This gives a list of the server and the OS but not the Service Pack level.
>
> Thanks for any help


My System SpecsSystem Spec
Old 04-12-2007   #4 (permalink)
Damon


 
 

Re: How to check service packs on remote computers.

Thanks guys, that worked great!

"Brandon Shell" wrote:

> $ser= get-Content c:\wmi\servers.txt
>
> foreach($s in $ser)
> {
> $ServicePack = Get-WmiObject Win32_OperatingSystem -ComputerName $s
> $ServicePack = $ServicePack.ServicePackMajorVersion
> Write-Host "Server [$s] has SP [$ServicePack]"
> }
>
> --
> Brandon Shell
> ---------------
> Stop by my blog some time
> Blog: http://www.bsonposh.com/
> PSH Scripts Project: www.codeplex.com/psobject
> --------------------------------------
>
> "Damon" <Damon@discussions.microsoft.com> wrote in message
> news:94E0DBA1-DABC-4A67-BC78-2BDC36FAF548@microsoft.com...
> > Hello,
> > I am wanting to write a script that will take a list of server names and
> > return the OS and service pack level.
> > I have written
> > $ser= get-Content c:\wmi\servers.txt
> > Get-WmiObject win32_osrecoveryconfiguration -computername $ser |
> > Format-Table __server, name
> > This gives a list of the server and the OS but not the Service Pack level.
> >
> > Thanks for any help

>
>

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
No service packs available? Vista General
Vista Service Packs Vista installation & setup
Vista Service Packs? Windows Updates
VISTA and XP next service packs? Vista General
Service Packs download size Vista General


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