#powershell SNMP Services Administration (Part 1)

This blog series explores the administration of SNMP configuration settings in Windows through PowerShell, a network monitoring protocol where it continues to be widely adopted.

Of interest are the Agent, Traps and Security tabs of the SNMP service when the properties are inspected using the services.mmc snap-in. These configurable items are stored in the Windows registry.

Note that these tabs are exposed when the SNMP Tools are separately installed from Server Manager or using Install-WindowsFeature RSAT-SNMP in Windows Server.

To start off our discussion, we shall take a look at the Agent tab. Next to the “Contact” and “Location” fields [1], there are a number of check-boxes listed as “Service”, namely:

Service name Value (Decimal)
Physical 1
Internet 4
Applications 64
End-to-end 8
Datalink and subnetwork 2
None of the above selected 0

These “services” are identified using the corresponding values and are stored in:

HKLM:\System\CurrentControlSet\Services\SNMP\Parameters\RFC1156Agent

specifically as the sysServices (REG_DWORD) registry key. These can be queried and edited using the Get- and Set-ItemProperty cmdlets in PowerShell.

To describe multiple “services”, simply add the values together and write the accumulated figure in the same Windows Registry location. For instance, a value of 72 indicates that both Applications and End-to-end are checked or enabled.

[1] sysLocation and sysContact under HKLM:\System\CurrentControlSet\Services\SNMP\Parameters\RFC1156Agent

Leave a Reply