blog.powershell.no

On Windows PowerShell and other admin-related topics

How to install an Excel Add-in with PowerShell

Recently I had the need to automate the process of installing Excel Add-ins in a terminalserver (or more correctly Remote Desktop Services environment since this was Windows Server 2008 R2) environment.

Since Excel Add-ins are per-user based, this was in the first place a manual setting. Of course we wanted to automate this process, so I researched a bit on the internet and found mostly VBScripts. I`ve used this KB-article as a template.

Although this worked very well, I`m trying to leverage the use of PowerShell as much as possible. Many would say that VBScripts load much faster, and are more effecient as logonscripts.
Even though PowerShell v1 was a bit slow due to the lack of assemblies not being ngen`ed, as described on the PowerShell Team`s Blog, this bug is fixed in v2 and I`m quite happy with the loading time now.

I basicly re-wrote the sample VBScript in the KB-article, the result are uploaded to PoshCode.org and available from here.

I used an if-statement to check if the Add-in are already installed, to avoid installing it on every logon.

When tested and ready for production, the script may be distributed as a traditional logonscript, or alternatively with Group Policy:

image

Advertisements

November 1, 2009 - Posted by | Group Policy, Remote Desktop Services, Scripting, Windows PowerShell, Windows Server 2008 R2 |

2 Comments »

  1. This code working perfect, but add-in is inactive. How we can activate it with powershell?

    Comment by Andrey | May 3, 2011 | Reply

  2. I realize this is quite old and Andrey may not see this (or anyone for that matter) but…. Andrey, did you figure out how to activate an add-in via Powershell (or any other way)? I’m currently needing to do the same thing for our lazy instructors and students.

    Comment by Mike Horton | September 26, 2011 | Reply


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

%d bloggers like this: