Syed Jahanzaib – سید جہانزیب – Personal Blog to Share Knowledge !

February 3, 2026

How to Install and Configure SNMP on Windows Server 2019 Using PowerShell


Introduction

Simple Network Management Protocol (SNMP) is widely used for monitoring servers, network devices, and infrastructure components. In Windows Server 2019, SNMP is available as a Windows feature and can be fully installed and configured using PowerShell, making it ideal for automation and audit-compliant deployments. We widely use it remotely monitor servers historical performance unclouding DUDE, LIBRENMS and other tools.

This article explains how to install SNMP, configure the community string, and allow access from any host using PowerShell only.


Prerequisites

Before proceeding, ensure:

  • You are logged in as a Local Administrator

  • PowerShell is running as Administrator

  • Windows Server version is 2019


Step 1: Install SNMP Service Using PowerShell

Run the following command to install the SNMP service along with management tools:

Install-WindowsFeature SNMP-Service -IncludeManagementTools

To verify installation:

Get-WindowsFeature SNMP-Service

The installation state should display as Installed.


Step 2: Configure SNMP Community String

SNMP community strings are stored in the Windows registry.
In this example, we configure a READ-ONLY community string named public.

New-ItemProperty `
-Path "HKLM:\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\ValidCommunities" `
-Name "public" `
-PropertyType DWORD `
-Value 4 `
-Force

Community Permission Values

  • 4 → Read-Only

  • 8 → Read-Write

  • 1 → None


Step 3: Allow SNMP Access from Any Host

By default, Windows restricts SNMP access to specific managers. To allow SNMP queries from any host, remove existing restrictions. (for testing , but later ensure you enter your management / monitoring ip so that it should be restricted.)

Remove current permitted managers (if any):

Remove-Item `
-Path "HKLM:\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\PermittedManagers" `
-Recurse `
-Force `
-ErrorAction SilentlyContinue

Recreate an empty key:

New-Item `
-Path "HKLM:\SYSTEM\CurrentControlSet\Services\SNMP\Parameters" `
-Name "PermittedManagers" `
-Force

An empty PermittedManagers key means SNMP access is allowed from all hosts.


Step 4: Restart SNMP Service

Apply changes by restarting the SNMP service:

Restart-Service SNMP

Verify service status:

Get-Service SNMP

Step 5 (Optional): Configure Windows Firewall

If SNMP polling does not work, ensure UDP port 161 is allowed:

New-NetFirewallRule `
-DisplayName "Allow SNMP UDP 161" `
-Direction Inbound `
-Protocol UDP `
-LocalPort 161 `
-Action Allow

Testing SNMP Connectivity

From your monitoring or management server, test SNMP access:

snmpwalk -v2c -c public <server-ip>

A successful response confirms that SNMP is working correctly.


Security Considerations

Allowing SNMP access from any host is not recommended for production environments unless additional controls are in place. Consider:

  • Restricting SNMP access using firewall rules

  • Using strong, non-default community strings

  • Migrating to SNMPv3 where encryption and authentication are required


Conclusion

Using PowerShell to install and configure SNMP on Windows Server 2019 provides a fast, repeatable, and audit-friendly approach. This method is especially useful for system administrators managing large environments or following strict SOPs.