(imported topic written by dmoore21)
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?