[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

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

  • December 14, 2015 at 7:14 pm
    Permalink

    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?

    Reply
    • December 27, 2015 at 1:39 pm
      Permalink

      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

      Reply
    • January 15, 2016 at 9:53 pm
      Permalink

      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:\temp\telephone.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? 😀

      Reply

Leave a Reply