Les, your code threw me for a moment (the ? after $ SS) but once tried it does appear to work with a lot less code. Using a combination of your and Howards code:

Code:

$OU = 'OU=Users,OU=Region2 New York City,DC=somedc,DC=somedc,DC=somedc,DC=some'
$SS = Split(Split($OU,',DC=')[0],',OU=')[1]
? $SS
$site = SubStr($SS, 9)
? $site



Returns:
Region2 New York City
New York City

Question for you. What does the apostrophe in your code do?

Whoops, just figured it out. Early morning and only two cups here so far.


Edited by BillRamby (2005-03-14 03:22 PM)