[PowerShell]–Checking the version of Office installed

While I could simply launched my Office that is installed locally to check the version, I am thinking how can I query all the computers within the organization or at least a group of computers.

Here is a few simple lines of code to start off with.

– Create and initialize the object

$objExcel = New-Object -ComObject Excel.Application

– Query the version of the Office installed

$objExcel.version

Results

16-12-2013 3-31-12 PM

– Query the build of the Office installed

$objExcel.build

Results

16-12-2013 3-32-45 PM

Isn’t that much more simple? Imaging if you were to do it from GUI, how many clicks are there to achieve the same results? Smile

[PowerShell]–Checking the version of Office installed

3 thoughts on “[PowerShell]–Checking the version of Office installed

  1. Jon says:

    Hi there,

    Thanks for this – very helpful!

    I’d like to be able to do this on all PC’s on our network, preferably by running it as a script on logon by Group Policy, and have the client machine save the output in a text file (I know this must sound long-winded…)

    How do I export this information into a text file, please?

    Like

    1. miltongsw says:

      Hi Jon,

      The easiest way to pipe the output to a file is to use “.script.ps1 > output.txt”. While there is also a cmdlet in PowerShell that is call “Out-File”. So you can just simply concatenate the output and pipe it out using the cmdlet to the text file. Just do a get-help on Out-File.

      Cheers!

      Regards,
      Milton

      Like

    2. James says:

      First of all Milton: thanks for this easy to use approach I really do like it! It´s straight forward and doesn´t need fiddling around in the Registry.

      For Jon I would recommend you to pipe to Export-CSV short demonstration:
      | Export-CSV C:temptelephone.csv -Encoding “UTF8” -Delimiter “;” -Force
      this makes a semicolon separated list of the selected Elements. Important is here the -Delimiter “;” 🙂
      Also the -Force overrides an existent file.
      I like this because here I can easily delete doubles/triples with one or two clicks.

      Of course better would be a database but well it works, doesn´t it? 😀

      Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s