| 
| 
| 
| #208702 - 2014-03-10 02:02 PM  Strange problem assigning list to array |  
| Glenn Barnas   KiX Supporter
 
       
   Registered:  2003-01-28
 Posts: 4401
 Loc:  New Jersey
 | 
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:
 and the new 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'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.; 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'
 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  (148 downloads)
 Description:
 
 
 
 
_________________________Actually  I am  a Rocket Scientist!   
 |  
| Top |  |  |  |  
| 
| 
| #208705 - 2014-03-10 06:53 PM  Re: Strange problem assigning list to array
[Re:  Glenn Barnas] |  
| ShaneEP   MM club member
 
       
   Registered:  2002-11-29
 Posts: 2127
 Loc:  Tulsa, OK
 | 
Could it be the space that was added in the string, rather than the space added between elements?
 
 '4.olddomain.net/DC=4,DC=olddomain,DC=net'
 '4.olddomain.net/DC=4, DC=olddomain,DC=net'
 Just thinking out loud really.  Trying to spot any possible differences.
 
 Edited by ShaneEP (2014-03-10 06:54 PM)
 |  
| Top |  |  |  |  
 Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
 
 | 
| 
 
| 0 registered
and 739 anonymous users online. 
 | 
 |  |