How To Configure SNMP Settings With Group Policy
We recently encountered an issue with a customer attempting to configure SNMP settings across all of their Windows servers. Of course the purpose was to send SNMP trap data to a monitoring station. There are two ways to accomplish this task.
The Easy Way - Group Policy Preferences
If you read our recent post on the Top 3 Active Directory Techniques That Are Often Overlooked you know that we are big fans of Group Policy Preferences (GPP). Using GPP we can accomplish complex tasks that used to require a great deal of scripting. Many of those tasks involved making changes to the registry. That is exactly how we are going to accomplish this task but GPP allows us to do this without a single line of code. All of the below actions take place under the registry key HKLM\System\CurrentControlSet\Services\SNMP\Parameters. During the step-by-step we will only reference the subkeys. Also, these steps assume you are familiar with GPP and the Windows registry.
1. Launch the Group Policy Management Console (GPMC) and create a new GPO or edit an existing one.
2. Navigate to Computer Configuration - Preferences - Registry.
3. Right click the Registry node and select New - Registry Item. Leave the Action and the Hive sections at the defaults.

4. Click the elipses to navigate to \PermittedManagers. Select the default entry of "1" and click OK. Enter your management station's IP and click OK. It should look similar to this.

5. Perform the same steps for the \RFC1156Agent subkey. Select the sysContact entry and click OK. Do the same with the sysLocation entry. Enter your contact and location information as illustrated below.

6. Next, go to the \TrapConfiguration subkey and click OK. Place your cursor in the Key Path box and move to the end of the entry. Now enter a "\" followed by the name of your community string. This will create the subkey for you. In our case it is called \SomeString. The default value name is "1". In the Value Data field enter the IP address of your management station. See below.

7. The last entry is the \ValidCommunities subkey. The Value Name will be the community string and the Value Data will be "4". The data type is REG_DWORD.

Now simply link your group policy and wait for the settings to apply.
The Hard Way - Scripting
If for whatever reason you are not using GPP or you simply have not upgraded your environment to the latest and greatest version of Active Directory, have no fear. Scripting is still an excellent option. Even better is the fact that you don't have to reinvent the wheel (nor do I). Our friends over at MyITforum have a very comprehensive script for this very problem. We tested it in our own labs and it works perfectly. Simply customize the script to your environment and configure it as a Group Policy startup script (after testing of course). You can get here.
Custom ADM Template
In part 2 of this post we discuss and make available for download a custom ADM template. The post includes screens shots of the end result as well as other helpful hints. Hop on over to SNMP Group Policy Settings Part 2 to download the ADM template.
Regardless of the method you choose let us know about your experience in the comments section. If you add any enhancements to the script or the GPP settings let us know so that we can pass on that knowledge to others. Enjoy!