Verify if SNMP is already installed.
Get-WindowsCapability -Online -Name SNMP*
Install the SNMP using PowerShell.
Get-WindowsCapability -name SNMP* -online | Add-WindowsCapability –Online
Tutorial Powershell - Configure the SNMP service
Configure the system contact.
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\services\SNMP\Parameters\RFC1156Agent" -Name "sysContact" -Value "Goku" -type String
Configure the system location.
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\services\SNMP\Parameters\RFC1156Agent" -Name "sysLocation" -Value "Planet 7" -type String
Configure a read-only SNMP community.
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\ValidCommunities" -Name "MYCOMMUNITY" -Value 4 -type DWord
Optionally, configure a read-write SNMP community.
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\ValidCommunities" -Name "MYRWCOMMUNITY" -Value 8 -type DWord
Configure the hosts allowed to query the SNMP service.
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\PermittedManagers" -Name "1" -Value "localhost" -type String
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\PermittedManagers" -Name "2" -Value "192.168.0.100" -type String
Restart the SNMP service.
Restart-Service -Name SNMP
5/5 - (1 vote)