Export Windows Server 2016 and 2019 Installed Roles And Features

In this article, I’ll will explain how to export Windows Server 2016 and 2019 installed roles and features to a .CSV file with a PowerShell one-liner. This PowerShell one-liner can be very handy when deploying for example a Windows Container and porting the applications from a VM to a Container.

Export Roles

To export all Windows Server 2016 or 2019 roles to a .CSV file and then use it on another server use, just execute the following PowerShell code:



Import Roles

Optionally, we could use the .CSV file to install a new Windows Server 2016 or 2019 with exactly the same roles and features with the following PowerShell code:


If you be sure, just remove -WhatIf parameter.

Thank you for spending some time at my site and in my blog. I hope you come to visit again soon 😉

About Lex van der Horst 201 Articles

Be the first to comment

Leave a Reply