Setting up or Updating SNMP via Powershell on a Windows Server 2012 R2 A little while ago, I had to write a Powershell function to update the SNMP settings from a bunch of servers running Windows 2012 R2 Server. The following cases had to be handled: - The SNMP feature could be missing or present. Mar 14, 2017 Enabling SNMP on Windows. On Windows workstations select Simple Network Management Protocol (SNMP) and install it. On Windows Server you'll have to click Next in the Add Roles and Features Wizard until you reach the Features sections where you can install the SNMP Service.
The simple network monitoring protocol (SNMP) is one of the most widely used protocols in the networking world. It is used to monitor a wide range of devices like routers, switches, desktops, servers, domain controllers, etc. But, before you can monitor the devices in your network using SNMP, you need to enable the SNMP service. This is a relatively simple process that can be done with the help of a vendor provided user-manual.
Likewise, enabling SNMP on Windows servers is also a simple task. But, what if you have to enable it on multiple Windows servers in a network that is distributed across domains and datacenters? That can be tedious and time-consuming. To make this easier, we have developed a script using Microsoft's PowerShell framework to remotely enable SNMP on Windows devices that run on Windows Server 2008, 2008 R2, 2012, 2012 R2 and 2016. Now, you can instanly discover and monitor your Windows servers using SNMP in OpManager.
Tip:
Wondering why you should monitor Windows devices using SNMP?
Monitoring Windows servers using SNMP comes with a host of benefits that include a more efficient use of the CPU, random access memory (RAM) and bandwidth resources, and also requires lesser number of ports for polling devices, unlike WMI.'
Wondering why you should monitor Windows devices using SNMP?
Monitoring Windows servers using SNMP comes with a host of benefits that include a more efficient use of the CPU, random access memory (RAM) and bandwidth resources, and also requires lesser number of ports for polling devices, unlike WMI.'
Steps to enable SNMP on Windows devices
Step 1: Download the SNMPEnabler.ps1 script.
Step 2: Open the Windows PowerShell utility as an administrator.
Step 3: Run the SNMPEnabler.ps1 script and provide the required input parameters.
Step 4: Now, execute the script with the provided inputs and it will automatically enable and configure SNMP on your local/ remote devices. Adobe tool download.
Note:
1. Please confirm if the prerequisites for remote execution are satisfied.
2. Ensure that the host and client devices are available on the same network domain. For multiple domains, you can use a remote device in that domain to execute the script on other Windows machines within that domain.
3. Enable PSRemoting on remote devices in which this script will be executed. This can be done with a Remote Desktop connection.
Prerequisites for remote execution
To create remote sessions and run remote commands the local and remote machine must meet below requirements.
System requirements:
These are the system requirements for script execution on remote machines.
i) To run remote sessions on Windows PowerShell 3.0, the local and remote computers must have the following:
- Windows PowerShell 3.0 or later
- The Microsoft .NET Framework 4 or later
- Windows Remote Management 3.0
ii) To run remote sessions on Windows PowerShell 2.0, the local and remote computers must have the following:
- Windows PowerShell 2.0 or later
- The Microsoft .NET Framework 2.0 or later
- Windows Remote Management 2.0
Full version of windows 7. User permissions:
By default, the current user must be a member of the administrators group on the remote computer (or) provide the credentials of an administrator.
Windows network/ firewall permission:
The firewall should not block the remote connection from both server and client side.
Run as administrator:
Administrator privileges are required to enable and configure SNMP.
Input parameters for script execution
The script can process the following inputs parameters.
Sl.No | Input parameter | Usage | Default values | Mandatory/ Optional | Example |
1 | h | Host name in which the SNMP service needs to be enabled. | - | Mandatory (if -f not given) | -h raj-3515 |
2 | f | Path of the file which contains multiple hosts. File format :(XXXXX.txt) opm-dev1 localhost 192.21.23.1 raj-3515.zohocorpin.com | - | Mandatory (if -h not given) | -f D:SNMPhostlist.txt |
3 | username | Username of the account which is used for remote access | - | Mandatory for remote machines Optional for the local host | -username workgroupadministrator |
4 | pass | Password of the account which is used for remote access | - | Optional for the local host Remote: It can be provided as an argument/ you'll be requested for the password during remote execution. | -pass password@123 |
5 | onlyConfigure | Used to Configure the SNMP settings on already SNMP enabled machines. Possible values true/false. If its true then script will only go for configuration. | false | Optional | -onlyConfigure true |
6 | communityName | The name in which the community will be added in SNMP. | public | Optional | -communityName opmcomunity |
7 | snmpType | Permission to be added from community string. Allowed integer values. '1' -NONE '2' -NOTIFY '4' -READONLY '8' -READWRITE '16' -READCREATE. | 4 | Optional | -snmpType 4 |
8 | permittedHost | The host which need SNMP access from the Remote machine. | default localhost machine Name from which the script has been executed. | Optional | -permittedHost opm-dev7 |
9 | debug | Used for debugging purpose. Possible values true/false. | false | Optional | -debug true |
Script commands and usage
1. Host Specific Enabling
Options to enable and configure a single host with default/ custom options.
Commands:
1.1. To enable and configure (with default options) SNMP in a local machine
Execute: .SNMPEnabler.ps1 -hlocalhost
1.2. To enable and configure (with default options) SNMP in a remote machine
Execute: .SNMPEnabler.ps1 -h<Remote_MachineName>-username<username>
Sunset overdrive pc download codex. 1.3. To enable and configure (with custom input options) SNMP in a local machine
Execute: .SNMPEnabler.ps1 -hlocalhost-communityName<communityName>-snmpType<snmpType>-permittedHost<permittedHost>
1.4. To enable and configure (with custom input options) SNMP in a remote machine
Execute: .SNMPEnabler.ps1 -h<Remote_MachineName>-username<username>-communityName<communityName>-snmpType<snmpType>-permittedHost<permittedHost>
1.5. To configure the community and permitted hosts on an SNMP enabled local machine
Execute: .SNMPEnabler.ps1 -hlocalhost-onlyConfiguretrue-communityName<communityName>-snmpType<snmpType>-permittedHost<permittedHost>
1.6. To configure the community and permitted host on an SNMP enabled remote machine
Execute: .SNMPEnabler.ps1 -h<Remote_MachineName>-username<username>-pass<password>-onlyConfiguretrue-communityName<communityName>-snmpType<snmpType>-permittedHost<permittedHost>
2. Bulk Enabling (using input file containing hosts)
By passing the file path which contains a list of hosts, we can enable and configure SNMP for multiple servers.
Commands:
2.1. To enable and configure (with default options) SNMP in multiple local/ remote machines
Execute: .SNMPEnabler.ps1 -f<filepath>-username<username>
2.2. To enable and configure (with custom options) SNMP in multiple local/ remote machines
Execute: .SNMPEnabler.ps1 -f<filepath>-username<username>-communityName<communityName>-snmpType<snmpType>-permittedHost<permittedHost>
2.3. To configure with community and permitted host on SNMP enabled local/ remote machines
Execute: .SNMPEnabler.ps1 -f<filepath>-username<username>-onlyConfiguretrue-communityName<communityName>-snmpType<snmpType>-permittedHost<permittedHost>
Click here to learn more about OpManager, and it's server monitoring capabilities. To know more on how to install and configure SNMP, visit the following links.
- Install and configure Windows device for SNMP.
- Install and configure Linux device for SNMP.
- Install and configure Solaris device for SNMP.
Active4 months ago
Windows 2012 Snmp V3
I have to configure the security settings for the SNMP-Service on a Windows Server. But they are missing!
Here are the facts:
- OS: Windows Server 2012 R2
- I installed the SNMP feature and I believe, that I already configured the service (but I forgot to add another IP under
Security
tab) - I know the issue where you have to restart the SNMP-service after you installed the feature to see the
Security
tab (so I made already some restarts.) - My colleague installed now the DC server role.
- Now I can not see the
Security
tab anymore (I don't know if it has to do something with the installation of the DC role). - I really need SNMP for monitoring reasons. (So please don't advise to use WMI or other things)
- I used my domain admin when clicking on 'SNMP-Service' --> 'Properties'
What can I do to see the
frupfrupfrupfrupSecurity
tab again? Basic programming language manual. Or is there a possibility to configure the SNMP service via CMD or PowerShell?6781 gold badge11 silver badges26 bronze badges
Windows Server 2012 Snmp Settings Guide
4 Answers
You need to install the SNMP Tools feature to get those tab pages, e.g. using the Powershell command
Install-WindowsFeature RSAT-SNMP
.Remember to restart the service manager before opening the properties page again.
IngoIngo
Windows Server 2012 Snmp Install
You need to open the services.msc from an elevated command line window (run as admin). Then you'll get the security tab!
UlliGTUlliGT
I found this site for config via registry:
- Dysan, IT Library blog, 2010-01-28, How to: Set SNMP settings through registry
I set up
PermittedManagers
and ValidCommunities
, and now it seems to work for me!REG_SZ
Value name: 1
Value data: (IP address of monitoring server)
REG_DWORD
Value Data: 4
Value Name: (community string)
(But if anyone has a hint why I can't see the
frupfrupfrupfrupSecurity
tab under Properties
I would be grateful anyway!)6781 gold badge11 silver badges26 bronze badges
I read on another website that closing the service.msc waiting a few seconds and opening it again will make the agent, security and traps tabs appear. Worked for me.https://martcj.wordpress.com/2012/03/29/snmp-service-has-no-agent-traps-or-security-tabs-to-configure-in-windows-2008/
vosvos