An xsl transform will take an xml file and transform it into another format. There are three transforms provided that you may find useful: Install.xsl, Remove.xsl, and View.xsl. <\/span><\/div>\n\u00b7<\/span>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span><\/span><\/span>Install:<\/b> This transform will create an xml file to use with ServerManagerCmd.exe -inputPath for installing roles and features that were detected on a server. See Appendix A.<\/span><\/span><\/p>\n\u00b7<\/span>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span><\/span><\/span>Remove:<\/b> This transform will create an xml file to use with ServerManagerCmd.exe -inputPath for removing roles and features that were not detected on the master server. \u00a0<\/span>See Appendix B.<\/span><\/span><\/p>\n\u00b7<\/span>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span><\/span><\/span>View:<\/b> This transform will create an html file that will display which roles and features are installed on the master server.\u00a0 <\/span>See Appendix C.<\/span><\/span><\/p>\n\n
<\/span><\/span>\u00a0<\/div>\nThese three xsl files can be found at the end of this article in appendix A, B, and C. Using copy and paste with your favorite text editor (ie. Notepad), save these files to your machine. Note that you won\u2019t want to use a fancier word processor that preserves html formatting tags.<\/span><\/div>\n3)<\/span>\u00a0\u00a0\u00a0 <\/span><\/span><\/span>Query the \u201cMaster\u201d Server<\/span><\/span><\/h2>\n\u00a0<\/span><\/div>\nGiven that you have the tools needed for the transform, you are ready to proceed. First, you will need to query a server for the roles and features that are installed. The server where this query is run will be referred to as the \u201cmaster\u201d server since it will essentially provide the list of roles and features that will potentially be installed on other servers. From an elevated command prompt on the master server, execute:<\/span><\/div>\n\u00a0<\/span><\/div>\nServerManagerCmd.exe -query Master.xml<\/span><\/span><\/div>\n\u00a0<\/span><\/div>\n4)<\/span>\u00a0\u00a0\u00a0 <\/span><\/span><\/span>Generate the Install xml input file<\/span><\/span><\/h2>\n\u00a0<\/span><\/div>\nNow that we have the xml from the query of the master server, we will generate the xml that can be used to install all of the roles and features that were detected on the master server as installed. The xml generated will be a list of all the roles and features that should be installed, but will not contain a list of the roles and features that should be uninstalled to match the set exactly on the target server.<\/span><\/div>\n\u00a0<\/span><\/div>\nRun the xsl tool to generate the input xml that will install all the roles, role services, and features that are installed according to query.xml<\/span><\/div>\n\u00a0<\/span><\/div>\nmsxsl.exe Master.xml install.xsl -o install.xml<\/span><\/span><\/div>\n\u00a0<\/span><\/div>\nIf you view Install.xml in a text or xml editor, you will notice a couple of things:<\/span><\/div>\n\u00b7<\/span>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span><\/span><\/span>There are a lot of blank lines in the file that can be ignored.<\/span><\/p>\n\u00b7<\/span>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span><\/span><\/span>The set of roles and features that are listed in the xml are not exactly what you see installed on your master server. The difference is that roles, role services, and features that contain other role services and features are not listed. At install time, they will automatically be included by Server Manager with the install. It is not possible to install a role service or feature without its parent.<\/span><\/p>\n5)<\/span>\u00a0\u00a0\u00a0 <\/span><\/span><\/span>Generate the Remove xml input file<\/span><\/span><\/h2>\n\u00a0<\/span><\/div>\nNext, we generate the xml that can be applied to remove all the roles and features that were not detected as installed on the master server. This would not be necessary if you are mirroring the roles and features to a machine where there are not any roles or features installed yet. Neither will you need this if you only want to use the previously generated Install xml to add roles and features instead of removing as well.<\/span><\/div>\n\u00a0<\/span><\/div>\nRun the xsl tool to generate the input xml that will remove all the roles, role services, and features that are not installed according to Master.xml<\/span><\/div>\n\u00a0<\/span><\/div>\nmsxsl.exe Master.xml remove.xsl -o remove.xml<\/span><\/span><\/div>\n\u00a0<\/span><\/div>\nAs with the Install.xml, you may notice that Remove.xml does not contain an exact mapping of what to uninstall. The reason is that if you request to uninstall a root role or feature, all sub role services and subfeatures will also be installed. Therefore, root nodes are not included in the list unless they don\u2019t have any children installed.<\/span><\/div>\n6)<\/span>\u00a0\u00a0\u00a0 <\/span><\/span><\/span>Use the Install and Remove xml input files<\/span><\/span><\/h2>\n\u00a0<\/span><\/div>\nNow you\u2019re ready to perform the installation of desired roles and features on a target server. First, run the following command (from an elevated command prompt) to add the desired roles and features. <\/span><\/div>\n\u00a0<\/span><\/div>\nServerManagerCmd.exe -inputPath Install.xml<\/span><\/span><\/div>\n\u00a0<\/span><\/span><\/div>\nIf some of the roles or features are already installed on the target server, there is no need to remove them from the install xml. Requesting to install a role or feature that is already installed will not have any effect. An informational message will simply be displayed to indicate that the role or feature did not need to be installed. <\/span><\/div>\n\u00a0<\/span><\/div>\nFinally, if you desire to remove roles or features that should not be present according to the master server, run the following command (from an elevated command prompt) to remove the extraneous roles and features. Again, if they are already not detected as installed on the target server, this will have no effect on the server.<\/span><\/div>\n\u00a0<\/span><\/span><\/div>\nServerManagerCmd.exe -inputPath Remove.xml<\/span><\/span><\/div>\n\u00a0<\/span><\/div>\nNote that neither of these commands will have any effect of installing or uninstalling when run on the master server where they were generated.<\/span><\/div>\n7)<\/span>\u00a0\u00a0\u00a0 <\/span><\/span><\/span>Generate the View html file<\/span><\/span><\/h2>\n\u00a0<\/span><\/div>\nThe last transform will convert the query xml into a friendly html file to view the available roles, role services, and features, with installed roles\/features highlighted in green. <\/span><\/div>\n\n
<\/span><\/span>\u00a0<\/div>\nmsxsl.exe Master.xml View.xsl -o View.html<\/span><\/span><\/div>\n\u00a0<\/span><\/div>\nNow open the View.html in your favorite web browser.<\/span><\/div>\n\u00a0<\/span><\/div>\nAppendix A: Install.xsl<\/span><\/h2>\n\u00a0<\/span><\/div>\n\n
<<\/span>xsl:stylesheet<\/span>\n<\/div>\n\n
xmlns:xsl<\/span>=<\/span>“http:\/\/www.w3.org\/1999\/XSL\/Transform<\/span>“<\/span>\n<\/div>\n\nxmlns:sm<\/span>=<\/span>“