Help to change registry "REG_DWORD" value


hello,

i'm wanting turn off (un-tick) the "send authentication trap" setting on "security" tab of snmp services using powershell on remote server. registry "reg_dword" called "enbledauthenticationtraps" , resides directly under $subkey and needs set "0" instead of "1"

$server = "srv01"    $basekey = [microsoft.win32.registrykey]::openremotebasekey(‘localmachine’, $server)  $subkey= $basekey.opensubkey("system\\currentcontrolset\\services\\snmp\parameters",$true)

can assist?

thank you

 

can try like

$server = "srv01"  $basekey = [microsoft.win32.registrykey]::openremotebasekey(‘localmachine’, $server) $subkey= $basekey.opensubkey("system\\currentcontrolset\\services\\snmp\parameters",$true) $valuename = “mydwordvalue1″ $valuedata = 123 $subkey.setvalue($valuename, $valuedata, [microsoft.win32.registryvaluekind]::dword)


if find post has answered question, please mark answer. if find post helpful in anyway, please click vote helpful.

don't retire technet



Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

Generating Event ID 91, 44 with CA (In Event Viewer with source as Certsvc)

Group policy default policy cannot be edited because network name not found

Problem when changing update source