My AD structure looks something like this:
 Code:
USA
 - <other divisions>
 - IS
   - 783-Tech Services
   - <other departments>
AUS
 - <other divisions>
 - IS
   - 964-Tech Services
   - <other departments>


So, this simple code:
 Code:
If InOU('AUS')
  'In AUS' ?
Else
  'Not in AUS' ?
EndIF

If InOU('USA')
  ' In USA' ?
Else
  'Not in USA' ?
EndIf


If InOU('783-Tech Services')
  ' In Tech Services' ?
Else
  'Not in Tech Services' ?
EndIf
Function InOU() goes here . . .
can tell me if I'm in Austrailia or the US, and if I'm in the US Tech Services dept. I just tested this code here with the function from my web site.

Get rid of the "=1", since functions that return boolean values won't necessarily return "1", but any non-zero value (often -1).

Note that my InOU function can do partial matches - if you have a "Operations" OU and a "Network Operations" OU, calling InOU('operations') will return true for either. Use the "Strict" option to force an "OU=Operations" match via InOU('operations', 1).

Glenn
_________________________
Actually I am a Rocket Scientist! \:D