strat has asked for the wisdom of the Perl Monks concerning the following question:
Dear monks,
I've searched perlmonks and google and MSDN, but haven't found a solution for my problem. It looks very similar to Problems with Win32::OLE and ADSI
I try to connect to a Win2003 Active Directory running on a specific server from remote and log on as a certain user. The client is WinXP and a member of a subdomain, and the connect works well with adsi-browsers or pure ldap browsers or Net::LDAP, ane even this way of ADSI:
my $conn = Win32::OLE->new("ADODB.Connection"); $conn->{Provider} = "ADsDSOObject"; $conn->Open("ADSI Provider");
works fine, but there I don't know how to specify a certain server/user/password.
But I've got the problem that I can't logon with perl and the following way of ADSI.
The Perl-code stripped down to the essentials looks about the following
#! /usr/bin/perl use warnings; use strict; use Win32; use Win32::OLE; use Win32::OLE::Variant; my $server = "10.6.5.4"; my $base = "DC=myCompany,DC=at"; my $user = "cn=Administrator,cn=Users,$base"; #my $user = "Administrator"; my $pass = 'abcdefg'; my $objNameSpace = Win32::OLE->GetObject("LDAP://$server/$base") or die "Error: can't create LDAP object: $!\n"; # until now, everything has been fine, but now... #my $connectString = "LDAP://$server/$base"; #my $connectString = "LDAP://$base"; #my $connectString = "LDAP://$server/"; my $connectString = "LDAP:///$base"; print "Connectstring: $connectString\n"; my $conn = $objNameSpace->OpenDSObject ($connectString, $user, $pass, 0x01); use Data::Dumper; print Dumper($conn); # conn is undef my $err = Win32::OLE->LastError(); die "Error in bind: $err\n" if $err;
It seems not to matter what I use in $connectString, I always get the following error message:
D:\StratSync>testADSI.pl Connectstring: LDAP://10.6.21.131/DC=mlhelab,DC=de $VAR1 = undef; Error in bind: Win32::OLE(0.1701) error 0x8002000e: "Unzulőssige Param +eteranzahl" in METHOD/PROPERTYGET "" D:\StratSync>
(not correct count of parameters in...)
Well, Activestate OLE-Browser and MSDN tell me:
Function OpenDSObject(lpszDNName As String, lpszUserName As String, lp +szPassword As String, lnReserved As Long) As Object
Well, I've got four parameters, and for lnReserved I used every single parameter from ADS_AUTHENTICATION_ENUM (even 0x200)
Have you got any idea what I'm doing wrong?
Best regards,
perl -e "s>>*F>e=>y)\*martinF)stronat)=>print,print v8.8.8.32.11.32"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: ADSI -> 0x8002000e Error
by neniro (Priest) on Jun 14, 2005 at 10:39 UTC | |
by strat (Canon) on Jun 14, 2005 at 10:59 UTC | |
by strat (Canon) on Jan 24, 2006 at 12:46 UTC |