How can I assign a label for the AD OU that any machine belongs to without causing a system performance problem?

We currently have more than 500 OUs that we target various group policy to and we would like to be able to target them that way in the K1000 as well.  As I understand it, when a machine checks in, every smart label/ldap label is run against it.  If I create an LDAP query for each OU, that means more than 500 indivdual SQL queries have to run every time a machine checks in which sounds bad to me.  Is there any AUTOMATED way to set a field or label with the OU that machine is in without running 500 queries?

0 Comments   [ - ] Hide Comments


Please log in to comment

Answer this question or Comment on this question for clarity



I have a custom inventory rule that checks the OU. You can then create a label based off of that.

Custom inventory rule:

RegistryValueReturn(HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine, Distinguished-Name, TEXT)
Answered 09/06/2013 by: dugullett
Red Belt

  • Thanks, I did not realise the OS was storing that there. Now the question is whether I can figure out how to remove the machine name from the Distinguished name and parse the rest of the OU. That probably has to be done in the SQL query.
    • Create your label with this.

      <Custom Inventory Rule Name> Contains <Name of OU>
      • Even with the machine name there the query for the label will look for that OU name.
  • Im thinking along the lines of a single scheduled ticket rule that checks the OU and applies the correct labels for all machines rather than 500 smart label queries each containing some specific OU name.
Please log in to comment