Topic
2 replies Latest Post - ‏2013-10-10T18:16:55Z by dmoore21
dmoore21
dmoore21
56 Posts
ACCEPTED ANSWER

Pinned topic SNMP community strings permissions

‏2013-09-19T19:13:32Z |

In the Windows registry, the SNMP community keys are stored as such:

HKLM\SYSTEM\CurrentControlSet\services\SNMP\Parameters\ValidCommunities\xxxx

Where key xxxx is equal to the community name and the value of the key is equal to the permissions.  The value of the key (and it's corresponding permission) can be one of the following:

1 - None
2 - Notify
4 - Read Only
8 - Read Write
16 - Read Create

I know that I can retrieve the name of the community with the following relevance:

((names of it) of values of it) of key "HKLM\SYSTEM\CurrentControlSet\services\SNMP\Parameters\ValidCommunities" of native registry

I also know that I can retrieve the value of the key with this bit of relevance:

(values of it) of keys "HKLM\SYSTEM\CurrentControlSet\services\SNMP\Parameters\ValidCommunities" of native registry
What I would like to do (and what I am having trouble with) is converting the integer value of the permission to the human readable form.  I've tried relevance like this:

if exists ((values of it) of key "HKLM\SYSTEM\CurrentControlSet\services\SNMP\Parameters\ValidCommunities" of native registry) then if ((values of it as string = "4") of key "HKLM\SYSTEM\CurrentControlSet\services\SNMP\Parameters\ValidCommunities" of native registry) then ("Read Only")

But that didn't work...  Any ideas?

Updated on 2013-09-19T19:14:09Z at 2013-09-19T19:14:09Z by dmoore21
  • NoahSalzman
    NoahSalzman
    675 Posts
    ACCEPTED ANSWER

    Re: SNMP community strings permissions

    ‏2013-09-27T22:15:24Z  in response to dmoore21

    How about this?



    q: (names of it, (if it = 1 then "None" else if it = 2 then "Notify" else if it = 4 then "Read Only" else if it = 8 then "Read Write" else if it = 16 then "Read Create" else "Error")) of values of key "hklm\system\currentcontrolset\services\snmp\parameters\validcommunities" of registry





    A: test-read-only, Read Only

    A: test-notify, Notify

    A: test-write, Read Write

    • dmoore21
      dmoore21
      56 Posts
      ACCEPTED ANSWER

      Re: SNMP community strings permissions

      ‏2013-10-10T18:16:55Z  in response to NoahSalzman

      Aha!  That work - thanks Noah!