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

Office Service Pack via PowerShell (WMI)

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 07-10-2007   #1 (permalink)
stahlerw
Guest


 

Office Service Pack via PowerShell (WMI)

I can retrieve the OS service pack via WMI with Powershell without a problem.
However, finding the Service Pack for Office is proving to be a bit more
difficult. I need to script this out and so far, have not been able to do so.

Any ideas?
Thanks!
Wes

My System SpecsSystem Spec
Old 07-10-2007   #2 (permalink)
Gaurhoth
Guest


 

Re: Office Service Pack via PowerShell (WMI)

Assuming you are trying to query remote computers you can use the following code to remotely query the registry:


$cn="computername"

$rk = [microsoft.win32.registrykey]:penremotebasekey([Microsoft.Win32.RegistryHive]::LocalMachine,$cn)



#Office 2007

$rr = $rk.opensubkey("SOFTWARE\Microsoft\Office\12.0\Common\ProductVersion")

$rr.getvalue("LastProduct")



#Office 2003

$rr = $rk.opensubkey("SOFTWARE\Microsoft\Office\11.0\Common\ProductVersion")

$rr.getvalue("LastProduct")


For a chart of the different versions and the service pack level they correspond to:

http://support.microsoft.com/kb/928116 For Office 2007
http://support.microsoft.com/kb/821549 For Office 2003


Gaurhoth





"stahlerw" <stahlerw@discussions.microsoft.com> wrote in message news:950CF751-E943-44E9-9DBB-7FF9A6375A6D@microsoft.com...
>I can retrieve the OS service pack via WMI with Powershell without a problem.
> However, finding the Service Pack for Office is proving to be a bit more
> difficult. I need to script this out and so far, have not been able to do so.
>
> Any ideas?
> Thanks!
> Wes

My System SpecsSystem Spec
Old 07-10-2007   #3 (permalink)
stahlerw
Guest


 

Re: Office Service Pack via PowerShell (WMI)

Thanks Gaurhoth.


"Gaurhoth" wrote:

> Assuming you are trying to query remote computers you can use the following code to remotely query the registry:
>
>
> $cn="computername"
>
> $rk = [microsoft.win32.registrykey]:penremotebasekey([Microsoft.Win32.RegistryHive]::LocalMachine,$cn)
>
>
>
> #Office 2007
>
> $rr = $rk.opensubkey("SOFTWARE\Microsoft\Office\12.0\Common\ProductVersion")
>
> $rr.getvalue("LastProduct")
>
>
>
> #Office 2003
>
> $rr = $rk.opensubkey("SOFTWARE\Microsoft\Office\11.0\Common\ProductVersion")
>
> $rr.getvalue("LastProduct")
>
>
> For a chart of the different versions and the service pack level they correspond to:
>
> http://support.microsoft.com/kb/928116 For Office 2007
> http://support.microsoft.com/kb/821549 For Office 2003
>
>
> Gaurhoth
>
>
>
>
>
> "stahlerw" <stahlerw@discussions.microsoft.com> wrote in message news:950CF751-E943-44E9-9DBB-7FF9A6375A6D@microsoft.com...
> >I can retrieve the OS service pack via WMI with Powershell without a problem.
> > However, finding the Service Pack for Office is proving to be a bit more
> > difficult. I need to script this out and so far, have not been able to do so.
> >
> > Any ideas?
> > Thanks!
> > Wes

My System SpecsSystem Spec
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with 2007 Microsoft Office Service Pack (SP1)? Bill Vista performance & maintenance 0 03-16-2008 09:43 PM
service pack 3 for office 2003 fixes vista issues! D. Solomon Vista General 8 09-19-2007 10:55 PM
Service pack 3 for Office XP does not install on Vista Machine Wilfried Vista installation & setup 0 04-08-2007 01:56 AM
Office XP Service Pack 3 Patch for Vista? Tim Yerks Vista General 13 04-05-2007 10:22 PM
Should I update Office XP Service Pack 3 on Vista dolts Vista General 5 02-22-2007 09:49 AM


Update your Vista Drivers Update Your 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