I suddenly started experiencing a problem that I cannot explain.

I am consolidating 4 "old" AD domains into a "new" domain. I have written a Kix script (see attached, domain names changed) that queries all 4 of the old domains, creating a report that contains the source domain name, an index number, a collection of user attributes, and then adds 5 calculated values to each record. 3 Index files are also created that include specific data. These index files are used to identify duplicate user or account names or email addresses that need to be changed prior to migration.

The script has been running for several months when, suddenly about 2 weeks ago, it started failing to collect data from the 4th domain in the list.

We made a subtle change to the script this weekend and the script began to work again. The original code:
 Code:
; Array of Source Domains                              v--Space                                    v--Space                                   v--NO Space
$aDomains = '1.olddomain.com/DC=1,DC=olddomain,DC=com', '2.olddomain.com/DC=2,DC=olddomain,DC=com', '3.olddomain.com/DC=3,DC=olddomain,DC=com','4.olddomain.net/DC=4,DC=olddomain,DC=net'
and the new code
 Code:
; Array of Source Domains                              v--Space                                    v--Space                                    v-- Space
$aDomains = '1.olddomain.com/DC=1,DC=olddomain,DC=com', '2.olddomain.com/DC=2,DC=olddomain,DC=com', '3.olddomain.com/DC=3,DC=olddomain,DC=com', '4.olddomain.net/DC=4, DC=olddomain,DC=net'
The only difference is the addition of a space between the third and fourth domain names in the list that assigns values to the $aDomains array.

When debugging, I displayed the values passed to the LDAPQuery() UDF and could not detect a difference in the values passed, but only when adding the space as shown above did the query work. Again, this worked for several months before suddenly throwing errors 2 weeks ago. The domain query logic is used in 5 other scripts that perform other tasks with the extracted data, all working until 2 weeks ago and now failing.

During testing, I removed the two middle domains and tested with just the first and last (with no space between) and it failed.. adding the space allowed it to work.

Does anyone have any insight as to why this subtle and seemingly irrelevant change would have such an impact?

Thanks,

Glenn

PS - the attached script requires at least two domains with trusts to function.


Attachments
extract.zip (149 downloads)
Description:


_________________________
Actually I am a Rocket Scientist! \:D