Thursday, September 10, 2015

ActiveNav Find Reference

I'll be out of communication when this goes live - this post is pre-scheduled.

ActiveNav's "find" command is very powerful and very useful for finding entries in Active Directory that satisfy a certain set of predicates, but it is also far and away the most complicated command in the program. Since it's made of subcommands, the in-program help is not very useful, so I have trouble remembering how to use it. This entry will be useful to me and maybe to other people if/when I release ActiveNav in a completed state.

The "find" command is invoked as find subcommand [parameters...]. Each entry in this list is a subcommand, presented in what is hopefully a useful order.

  • load downloads all entries that are children - directly or indirectly - of the current entry, and prepares them for querying. No parameters. This will hit network utilization really hard if your Active Directory is big and you're at the root entry. Every other subcommand requires that a load has been issued.
  • list produces a list of entries currently in the result set, with result ID and entry name. No parameters.
  • go moves the current entry to the one in the result set with the numeric ID specified as the only parameter.
  • goname moves the current entry to the one in the result set with the name specified as the only parameter.
  • back moves the current entry to whatever it was before go or goname was used. No parameters.
  • filter narrows down the result set to only entries that match the predicate given as parameters. The first parameter after "filter" is the name of the object attribute being filtered on, the second is the verb/comparison (see the filter list below), and the third is the parameter to the verb. An exclamation mark before the verb inverts the filter so it leaves only entries that do not match it.
  • sort reorders the entries in the result set. The first parameter after "sort" is the name of the object attribute being compared, and the second is the comparison function (see below for sort verbs). An exclamation mark before the verb creates a descending sort.
  • flip reverses the order of the entries in the result set. No parameters.
  • cut leaves only the first N entries in the result set, with N being a number specified as the only parameter.
  • undo reverts the last change to the result set. "flip" changes do not count, and will be undone along with whatever was before them if they were the last change. There was a good reason for this, but I don't remember it. No parameters.
  • unfilter also puts the result set back to what it was before the last change, but "undo" can undo the unfiltering. No parameters.
  • clear removes everything from the result set, and clears the undo history.
Filter verbs:
  • is compares string values for equality.
  • like uses the Like (wildcard) comparison to compare string values for likeness.
  • = compares integer values for equality.
  • > checks whether the attribute is numerically greater than the parameter. Use !> for "less than or equal."
  • < checks whether the attribute is numerically lesser than the parameter. Use !< for "greater than or equal."
  • before checks whether the attribute is a date/time before the parameter.
  • after checks whether the attribute is a date/time after the parameter.
  • has checks whether the attribute is a list containing the parameter.
  • haslike checks whether the attribute is a list containing an entry that is wildcard-like the parameter.
  • cobefore is like before, but works on System.__ComObject entries that are actually dates.
  • coafter is to after as cobefore is to before.
  • bit checks whether the attribute has any of the bits that are set in the parameter.
  • and checks whether the attribute has all of the bits that are set in the parameter.
Sort verbs:
  • num compares values numerically.
  • str compares values alphabetically.
  • date compares dates.
  • codate compares System.__ComObject entries that are actually dates.
Special attribute names that work in "sort" and "filter":
  • . (a period) is the entry's name minus the LDAP cruft.
  • * (an asterisk) is the entry's non-fully-qualified name, but with the LDAP prefix.
  • ` (a backtick) is the entry's schema class name minus the LDAP prefix.
  • ~ (a tilde) is the entry's schema class name, including the LDAP prefix.

No comments:

Post a Comment