How to install roles and features via a script linked to an OU, to automate server builds


  • Hi all

    I like to automate the installation of roles and features applied to servers via GPO script.

    For my bare metal 2008 R2 installations, a simple .cmd script with something similar to below...

    ServerManagerCmd.exe -install NET-Framework-Core Hyper-V Desktop-Experience SNMP-Service -restart

    ...added to the RunOnce registry key via GPO would deliver Roles and Features reliably.

    This method does not work for me in 2012 R2.  I've spent a day searching the internet.  I cannot find a guide.  I assume I need to use Powershell now.  I am uncertain if signing scripts is a requirement for this to work for me?  Please could you let me know a method to automate the installation of Roles and Features to 2012 R2 via scripts delivered to bare metal servers via GPO.

    • Moved by Bill_Stewart Thursday, January 02, 2014 10:04 PM Off-topic post
    Tuesday, December 17, 2013 6:55 PM

All replies

  • I think you would do better by posting in the Windows 2012 forum.  The issue is more likely that the exact name of the service or package has changed.

    There are new tools in 2012 to install features and roles. I do not think they can be run from a GPO. 

    Here are the instructions:

    They show you explicitly how to discover the available Features and Roles on 2012 and how to use PowerSHell to install them.


    Tuesday, December 17, 2013 7:30 PM
  • Thanks for the link. I'll revisit the switches I'm using in my method.
    Tuesday, December 17, 2013 8:17 PM