title: Powershell - Refresh SNMP from registry or do a SNMPServiceResetEvent
body: <p>I've written a powershell script that writes registry entries for network drivers to change DCB settings. Things like turning DCB on and off, defining traffic classes and bandwidth groups. After writing the values to registry sometimes you cannot see the changes with SNMP remotely. Though this is inconsistent. </p>
  
  <p>I've scoured the web to see if there is a way to force SNMP to get its values from registry again. We have a script that sets the values in SNMP which automatically changes the registry. I'm trying to go the opposite way and set the values in the registry and have the MIB updated. I've tried reseting the SNMP service and network device in the script with no luck.</p>
  
  <blockquote>
    <p>After modifying the registry, do a SetEvent on the global event named
    "SNMPServiceResetEvent". (That is, do a CreateEvent to that named event and
    then do a SetEvent). That should cause the agent to reintialize using the
    current registry values.
    Jeff Kelley
    Microsoft / Windows CE Networking</p>
  </blockquote>
  
  <p>The only thing I've found that sounds like what I need is the above quote, though futher research suggests he is talking about C++ or C#. Is there a way to do what he suggests in powershell? I found a New-Event commandlet though I'm unsure of its suitability to the current task. Code I've tried:</p>
  
  <pre><code>$snmpService = New-Event -sourceidentifier dcbScriptSnmpReset -sender     SNMPServiceResetEvent -messagedata "Reset SNMP to refresh Registry"
  </code></pre>
  
  <p>Though there is no Set-Event commandlet and I don't know how to proceed.</p>
  
  <p>Any help or leads would be much appreciated.</p>
  
  <p>Thanks,
  Marcus</p>