Q: Using Windows Server 2012, how do I install roles and features to multiple servers at the same time?

A: Windows Server 2012 Server Manager allows management of multiple servers concurrently. However, for remote roles and feature installation, only a single server can be specified. To install roles and features to multiple servers concurrently, use this Windows PowerShell cmdlet:

Install-WindowsFeature cmdlet 

and call using this cmdlet:

Invoke-Command

passing the list of computers. For example, using the commands in this manner

PS C:\> $cred = Get-Credential
PS C:\> Invoke-Command -ComputerName savdalbfs08, savdalscs01 -Credential $cred -scriptblock {Install-WindowsFeature desktop-experience -Restart -WhatIf}

results in the following output (note that I have used -whatif, which means nothing will actually happen):


What if: Checking if running in 'WhatIf' Mode.
What if: Checking if running in 'WhatIf' Mode.
What if: Performing installation for "[User Interfaces and Infrastructure] Desktop Experience".
What if: Performing installation for "[Ink and Handwriting Services] Ink Support".
What if: Performing installation for "[Ink and Handwriting Services] Ink and Handwriting Services".
What if: Performing installation for "[Media Foundation] Media Foundation".
What if: This server may need to be restarted after the installation completes.

Success Restart Needed Exit Code Feature Result PSComputerName
------- -------------- --------- -------------- --------------
True Maybe Success {Desktop Experience, Ink Support, Ink and ... savdalscs01
What if: Performing installation for "[User Interfaces and Infrastructure] Desktop Experience".
What if: Performing installation for "[Ink and Handwriting Services] Ink Support".
What if: Performing installation for "[Ink and Handwriting Services] Ink and Handwriting Services".
What if: Performing installation for "[Media Foundation] Media Foundation".
What if: This server may need to be restarted after the installation completes.
True Maybe Success {Desktop Experience, Ink Support, Ink and ... savdalbfs08

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish