ridicurious.com
Powershell

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:

lab

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’]

 

Related posts

Book Update: PowerShell Guide to Python is 80% complete!

Prateek Singh
5 years ago

PowerShell Influencer of the Week – Stéphane Van Gulick

Prateek Singh
5 years ago

Weekly Newsletter – PowerShell Digest #014

Prateek Singh
3 years ago
Exit mobile version