Fri Jan 24 13:28:00 2014: Request 92443 was acted upon.
Transaction: Ticket created by dv...@bsu.by
       Queue: Win32-OLE
     Subject: LDAP assumes no one nor children
   Broken in: (no value)
    Severity: (no value)
       Owner: Nobody
  Requestors: dv...@bsu.by
      Status: new
 Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=92443 >


I got a problem with LDAP search.
There are subcontainers on some computers, I want to scan and DELETE them all 
before deleting that computers from my AD.

But I found, that LDAP search can not do "one" or "children" searches:

        use Win32::OLE;
....
        my $Conn = Win32::OLE->CreateObject("ADODB.Connection");
        $Conn->{Provider} = "ADsDSOObject";
        $Conn->Open('ADSI Provider');
        $NAME='CN=FPMI230srv....DC=bsu';
....
        my $COMPUTER = 
$Conn->Execute("\<$LDAP$NAME\>;(objectClass=*);cn,ObjectClass;children");
        print STDERR "4ERR:",Win32::OLE->LastError(),"\n";
4ERR:0
        $NAME2=$COMPUTER->Fields(0)->Value;
  DB<2> p $NAME2
FPMI230srv
  DB<3> p $COMPUTER->Fields(0)->Name
cn
  DB<3> p $COMPUTER->Fields(1)->Name
ObjectClass;children

Not only "scope" ignored, its attached to the last field! 3 hours of debugging.

Same for one: instead on "one" scope, I see an "ObjectClass;one" field. Yes, I 
can do "subtree", but I do not need subtree.

>perl -V

Summary of my perl5 (revision 5 version 8 subversion 4) configuration:
  Platform:
    osname=MSWin32, osvers=4.0, archname=MSWin32-x86-multi-thread
    uname=''
    config_args='undef'
    hint=recommended, useposix=true, d_sigaction=undef
    usethreads=undef use5005threads=undef useithreads=define 
usemultiplicity=define
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cl', ccflags ='-nologo -Gf -W3 -MD -DNDEBUG -O1 -DWIN32 -D_CONSOLE 
-DNO_STRICT -DHAVE_DES_FCRYPT  -DNO_HASH_SEED
 -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO 
-DPERL_MSVCRT_READFIX',
    optimize='-MD -DNDEBUG -O1',
    cppflags='-DWIN32'
    ccversion='', gccversion='', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=10
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='__int64', 
lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='link', ldflags ='-nologo -nodefaultlib -release  
-libpath:"C:\progra~1\perl\Perl\lib\CORE"  -machine:x86'
    libpth=\lib
    libs=  oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib  
comdlg32.lib advapi32.lib shell32.lib ole32.lib
oleaut32.lib  netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib  version.lib 
odbc32.lib odbccp32.lib msvcrt.lib
    perllibs=  oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib  
comdlg32.lib advapi32.lib shell32.lib ole32.
lib oleaut32.lib  netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib  
version.lib odbc32.lib odbccp32.lib msvcrt.lib
    libc=msvcrt.lib, so=dll, useshrplib=yes, libperl=perl58.lib
    gnulibc_version='undef'
  Dynamic Linking:
    dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
    cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -release  
-libpath:"C:\progra~1\perl\Perl\lib\CORE"  -machine:
x86'


Characteristics of this binary (from libperl):
  Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES 
PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS
  Locally applied patches:
        ActivePerl Build 810
        22751 Update to Test.pm 1.25
        21540 Fix backward-compatibility issues in if.pm
  Built under MSWin32
  Compiled at Jun 17 2004 21:47:33
  %ENV:
    PERL="c:\Program Files\perl"
  @INC:
    C:/Program Files/Perl/lib
    C:/Program Files/Perl/site/lib
    .

Reply via email to