# SNMP servisini yükleme
Install-WindowsFeature SNMP-Service, SNMP-WMI-Provider, RSAT-SNMP
# SNMP servisine genel ayarlar yapma
$community = "public"
$location = "Server Location"
$contact = "Admin Contact"
# SNMP servisini yapılandırma
reg add "HKLM\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\ValidCommunities" /v $community /t REG_DWORD /d 4 /f
reg add "HKLM\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\RFC1156Agent" /v sysLocation /t REG_SZ /d $location /f
reg add "HKLM\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\RFC1156Agent" /v sysContact /t REG_SZ /d $contact /f
# SNMP servisini başlatma
Start-Service SNMP
# SNMP servisine sadece belirli IP adreslerinden erişim izni vermek için Güvenlik Duvarı kuralları ekleniyor
$allowedIPs = @("10.80.43.5", "185.254.237.248")
foreach ($ip in $allowedIPs) {
New-NetFirewallRule -DisplayName "Allow SNMP from $ip" -Direction Inbound -Action Allow -Protocol UDP -LocalPort 161 -RemoteAddress $ip
}
# SNMP servis durumunu kontrol etme
Get-Service SNMP
# SNMP Hizmeti için Topluluk Adı Ayarları
$communityName = "public"
$communityPermission = 8 # 4: READ ONLY, 8: READ WRITE
# Kayıt defterinde SNMP ayarlarını yap
$snmpRegPath = "HKLM:\SYSTEM\CurrentControlSet\Services\SNMP\Parameters"
# Topluluk adı ve izinlerini ayarla
New-Item -Path "$snmpRegPath\ValidCommunities" -Force
Set-ItemProperty -Path "$snmpRegPath\ValidCommunities" -Name $communityName -Value $communityPermission
# SNMP Paketlerini Kabul Edecek IP Adreslerini Ayarla
New-Item -Path "$snmpRegPath\PermittedManagers" -Force
New-ItemProperty -Path "$snmpRegPath\PermittedManagers" -Name "1" -Value "185.254.237.248"
Restart-Service -Name snmp
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}