Powershell : How to Retrieve List of Installed Roles on Servers in your Infrastructure
For documentation purpose or just to understand your environment better below script could be useful in order to fetch the list of roles installed on a list of servers.
First, prepare a list of servers in a notepad file and save it.
Then modify the parameters on the below script with your details:
Once you’ll run the script you will get the list of server roles installed on each machine in the list this:
You can Export the data into a excel file by piping the last cmdlet of the script into Export-CSV cmdlet.
PLEASE NOTE : This Script just give you Installed Roles, Not the installed features. To include features as well in the results, please remove the -and $_.featuretype -eq ‘Role’ from the script
Hope you’ll find it useful, cheers!
[twitter-follow screen_name=’singhprateik’ show_count=’yes’]