WordPress.com
$pmanagers = @("ABC.DEF.GHI.XXX","ABC.DEF.GHI.XXX,"ABC.DEF.GHI.XXX","ABC.DEF.GHI.XXX","ABC.DEF.GHI.XXX")
# ADD YOUR MANAGER(s) in format @("manager1","manager2")
$CommString = @("COMMUNITY")
# ADD YOUR COMM STRING(s) in format @("Community1","Community2")
#Import ServerManger Module
Import-Module ServerManager
$check = Get-WindowsFeature -Name SNMP-Service
If ($check.Installed -eq "True"){
Write-Host "Configuring SNMP Services..."
#Set SNMP Permitted Manager(s) ** WARNING : This will over write current settings **
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SNMP\Parameters\PermittedManagers" /v 1 /t REG_SZ /d localhost /f | Out-Null
#Set SNMP Traps and SNMP Community String(s) - *Read Only*
#Deleting the PermittedManagers
Remove-Item "HKLM:\SYSTEM\CurrentControlSet\services\SNMP\Parameters\PermittedManagers\" -Force -Confirm:$false | Out-Null
#Adding Localhost to the PermittedManagers
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SNMP\Parameters\PermittedManagers" /v 1 /t REG_SZ /d localhost /f | Out-Null
Foreach ($String in $CommString){
reg add ("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SNMP\Parameters\TrapConfiguration\" + $String) /f | Out-Null
# Set the Default value to be null
reg delete ("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SNMP\Parameters\TrapConfiguration\" + $String) /ve /f | Out-Null
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SNMP\Parameters\ValidCommunities" /v $String /t REG_DWORD /d 4 /f | Out-Null
$i = 2
Foreach ($Manager in $PManagers){
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SNMP\Parameters\PermittedManagers" /v $i /t REG_SZ /d $manager /f | Out-Null
reg add ("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SNMP\Parameters\TrapConfiguration\" + $String) /v $i /t REG_SZ /d $manager /f | Out-Null
$i++
}
}
}
# Create a Firewall Rule to allow SNMP
netsh advfirewall firewall add rule name=”SNMP” dir=in action=allow protocol=UDP localport=161 remoteip="ABC.DEF.GHI.XXX","ABC.DEF.GHI.XXX,"ABC.DEF.GHI.XXX","ABC.DEF.GHI.XXX","ABC.DEF.GHI.XXX" | Out-Null
# Restart SNMP Service
Restart-service SNMP -Confirm:$false -Force | Out-Null
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related searches
- wordpress passing data between pages
- wordpress business templates
- wordpress rss feed not working
- wordpress jquery is not defined
- create wordpress blog
- wordpress roles editor
- wordpress full rss feed
- wordpress rss feed settings
- wordpress rss feed plugin
- wordpress display rss feed
- wordpress rss feed link
- wordpress rss feed to post