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
Post a Comment