I was on a drive to enable SNMP feature on all our Windows 2012 R2 servers in order to monitor the CPU, Memory and Disk utilization through WMI.
Trying to do this manually using the Windows Roles and Features for over 40 servers was not practical as it was time consuming. As a result, I venture out to seek a way to do this on a widescale in the shortest possible time.
Now here comes Powershell, it has save the day with it’s easy-to-use cmdlets and remote execution from any Windows machine.
I am now going take this opportunity to show what I have done to complete this task.
The following cmdlet is what you will use to install any windows features from the server roles:
This cmdlet is used to get the Windows features that are currently installed on the server:
Get-WindowsFeature [FeatureName] -computerName [NameOfComputer]
You can include the Features name in the command in order to get the status of the particular feature.
This cmdlet is used to install the windows features:
Install-WindowsFeature [FeatureName] -computerName [NameOfComputer]
Using the cmdlets above, the following commands were executed to install the SNMP-Service feature:
PS C:\> Get-WindowsFeature SNMP-Service -ComputerName TestWinServer
results:

Installing Windows features SNMP-Service for the 2012 R2 server TestWinServer
PS C:\> Install-WindowsFeature SNMP-Service -ComputerName TestWinServer
Results:

After installing this feature, I was able to configure the SNMP services and set my monitoring tool to pull the information from WMI using snmp.
I hope this article was helpful.