(imported comment written by liuhoting)
Here are some relevance queries you can run. In these examples, I’m using the string explicitly to do string comparisons since I’m not in the same active directory environment as you. You should use:
if exists value of settings “_BESClient_ActiveDirectoryPathOverride” of client then value of setting “_BESClient_ActiveDirectoryPathOverride” of client else if exists true whose (if true then exists distinguished name of local computer of active directory else false) then distinguished name of local computer of active directory else “”
instead, but these should give you the basic concept.
Basically the idea is we can do the string comparison over and over… I’m comparing only in the case of HICKORY and DULUTH here:
Q: if (“CN=PCNAME,OU=Workstations,OU=HICKORY ,OU=STATE,OU=MIT,DC=DOM,DC=core,DC=DOMAIN,DC=com” as string contains “HICKORY”) then “HICKORY” else if (“CN=PCNAME,OU=Workstations,OU=HICKORY ,OU=STATE,OU=MIT,DC=DOM,DC=core,DC=DOMAIN,DC=com” as string) contains “DULUTH” then “GHOST” else “NOTHING”
A: HICKORY
T: 0.270 ms
Q: if (“CN=PCNAME,OU=Workstations,OU=DULUTH ,OU=STATE,OU=MIT,DC=DOM,DC=core,DC=DOMAIN,DC=com” as string contains “HICKORY”) then “HICKORY” else if (“CN=PCNAME,OU=Workstations,OU=DULUTH ,OU=STATE,OU=MIT,DC=DOM,DC=core,DC=DOMAIN,DC=com” as string) contains “DULUTH” then “DULUTH” else “NOTHING”
A: DULUTH
T: 0.058 ms
Q: if (“CN=PCNAME,OU=Workstations,OU=BLAH ,OU=STATE,OU=MIT,DC=DOM,DC=core,DC=DOMAIN,DC=com” as string contains “HICKORY”) then “HICKORY” else if (“CN=PCNAME,OU=Workstations,OU=BLAH ,OU=STATE,OU=MIT,DC=DOM,DC=core,DC=DOMAIN,DC=com” as string) contains “DULUTH” then “DULUTH” else “NOTHING”
A: NOTHING
T: 0.059 ms
But if you have lots of strings that you need to check for you have to basically run that big active directory check again and again which is really annoying… Luckily you can be clever and do something like this instead:
Q: (if (it contains “HICKORY”) then “HICKORY” else if (it contains “DULUTH”) then “DULUTH” else “NOTHING”) of “CN=PCNAME,OU=Workstations,OU=HICKORY ,OU=STATE,OU=MIT,DC=DOM,DC=core,DC=DOMAIN,DC=com”
A: HICKORY
T: 0.052 ms
Q: (if (it contains “HICKORY”) then “HICKORY” else if (it contains “DULUTH”) then “DULUTH” else “NOTHING”) of “CN=PCNAME,OU=Workstations,OU=DULUTH ,OU=STATE,OU=MIT,DC=DOM,DC=core,DC=DOMAIN,DC=com”
A: DULUTH
T: 0.053 ms
Q: (if (it contains “HICKORY”) then “HICKORY” else if (it contains “DULUTH”) then “DULUTH” else “NOTHING”) of “CN=PCNAME,OU=Workstations,OU=BLAH ,OU=STATE,OU=MIT,DC=DOM,DC=core,DC=DOMAIN,DC=com”
A: NOTHING
T: 0.061 ms
Hopefully this helps…