Custom inventory rules w/ RegEx or Wildcards
We want to "flag" end-user systems that have mapped a particular network drive.
The Registry key HKEY_CURRENT_USER\Network\X (where X can be any drive letter) has the value that we want. So, we draft up a custom rule that looks something like:
This is literally duplicated for every value of X for E to Z. Needless to say, it's pretty ugly to look at for twenty-two occurrences and is kind of hack. It'd be nice to bring this down to just a few lines, ideally one. Does the KBOX have any support for wildcards or RegEx in this capacity? Something that would make this query less of an eyeball sore to look at?
The Registry key HKEY_CURRENT_USER\Network\X (where X can be any drive letter) has the value that we want. So, we draft up a custom rule that looks something like:
RegistryValueEquals(HKEY_CURRENT_USER\Network\X, RemotePath, MappedPathHere) OR
This is literally duplicated for every value of X for E to Z. Needless to say, it's pretty ugly to look at for twenty-two occurrences and is kind of hack. It'd be nice to bring this down to just a few lines, ideally one. Does the KBOX have any support for wildcards or RegEx in this capacity? Something that would make this query less of an eyeball sore to look at?
0 Comments
[ + ] Show comments
Answers (1)
Please log in to answer
Posted by:
GillySpy
13 years ago
Keep in mind that CURRENT_USER will only be relevant when someone is logged in. But that's probably okay since the mapping likely only exists when the user is logged in.
If you are just looking for the occurrence of a mapping maybe you could do a "net use" output and parse it into a CI rule for shell command
E.g.
or a vbs script that does the same kind of thing: http://www.kace.com/support/kb/index.php?action=artikel&cat=5&id=968&artlang=en
You could capture the entire listing and then have a smart label or report or email alert based on the contents.
If you are just looking for the occurrence of a mapping maybe you could do a "net use" output and parse it into a CI rule for shell command
E.g.
net use | find /I "RemotePath"
or a vbs script that does the same kind of thing: http://www.kace.com/support/kb/index.php?action=artikel&cat=5&id=968&artlang=en
You could capture the entire listing and then have a smart label or report or email alert based on the contents.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.