Installs SNMP for monitoring integrations, again handling both the server feature and the client capability, and verifies the service exists afterwards. It ends with the reminder that installing SNMP is only half the work: community strings and permitted managers still have to be configured before it is safe.
powershell
# Install SNMP Service
# Single use case: install the SNMP service for monitoring integrations
#-----------------------------------------------------------------
function Write-Log {
param($Message)
Write-Host "<WRITE-LOG = `"*$Message*`">"
}
$svc = Get-Service -Name SNMP -ErrorAction SilentlyContinue
if ($svc) {
Write-Log "SNMP service is already installed ($($svc.Status)) - nothing to do."
return
}
if (Get-Command Install-WindowsFeature -ErrorAction SilentlyContinue) {
Write-Log "Installing SNMP-Service feature (Windows Server)..."
$result = Install-WindowsFeature -Name SNMP-Service -IncludeManagementTools
if (-not $result.Success) {
Write-Log "WARNING: feature installation failed (exit: $($result.ExitCode))."
return
}
} else {
Write-Log "Installing SNMP capability (Windows client)..."
$cap = Get-WindowsCapability -Online -Name "SNMP.Client*" | Select-Object -First 1
if ($null -eq $cap) { Write-Log "SNMP capability not found in this image."; return }
Add-WindowsCapability -Online -Name $cap.Name | Out-Null
}
Start-Sleep 2
$svc = Get-Service -Name SNMP -ErrorAction SilentlyContinue
if ($svc) {
Write-Log "SNMP service installed ($($svc.Status))."
Write-Log "NOTE: configure community strings/permitted managers before use."
} else {
Write-Log "WARNING: SNMP service not found after installation!"
}Run it across your fleet
This script runs as-is on a single host. Paste it into ServerEngine to schedule it, run it on a whole server group in parallel, and keep the credentials out of the file — see the scripts documentation and the credential store.
More in Software Deployment
Install a Windows Feature with PowerShell
2026-08-17Install the RSAT Active Directory PowerShell Module
2026-08-17Silently Install PowerShell 7 Alongside 5.1
2026-08-17Uninstall Software by Name with PowerShell
2026-08-17Install Windows Updates with PSWindowsUpdate
2026-08-17Automating Software Deployment with PowerShell
2025-01-04Ready when you are.
Try ServerEngine free for 7 days.