The installation script, originally referenced here, has been updated to version 1.5. It adds support for installing just the management tools, including on Windows 7. I was in the process of making it work on Vista as well, but it got messy because dism doesn’t come with Vista and I didn’t want to have separate installation routines for Windows 7 and Vista. So I am making the assumption that anyone who wants to install the management tools on a workstation has long given up on Vista.

To detect the OS (which is actually difficult and not uniform by any means) and make sure it is 64-bit, this sections is added:

PowerShell

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

# Detect correct OS here and exit if no match

$wmiOS=Get-WMIObjectwin32_OperatingSystem

$OScap=$wmiOS.Caption

$OSver=$wmiOS.Version

[array]$wmiProc=Get-WmiObjectwin32_Processor

if($wmiProc[0].Architecture-eq'9')

{

if($OScap-match'Windows 7')

{$os='Win7'}

elseif(($OSver-eq'6.1.7600')-and($OScap-match'2008'))

{$os='R2'}

elseif($OSver-eq'6.0.6002')

{$os='R1'}

else

...

Getting the processor as an array makes it work with both single and multi-processors. As a reader kindly pointed out, when run on an R2 server, it kept thinking WinRM wasn’t installed. This is because WinRM is preinstalled on R2 so the check for the hotfix KB installation will always fail. It now skips the WinRM check for an R2 server.

I also updated the menu so you can select the management tools, and made it so you only are given the option of selecting the management tools when run on Windows 7. (Only the menu reflects this restriction. If you select a different option the script will still try and run that command.) The download link is below.

Scott, for what it’s worth, I built a new 2008 R2 server and went straight for KB982526, which I believes supersedes KB958484, which your script checks for. I had to disable the check for that hotfix to get the script to run.