Win32::OLE Connection using another users credentials???

Win32::OLE Connection using another users credentials???

am 25.01.2006 03:37:58 von Jackson

This is a multi-part message in MIME format.

--===============1214087460==
Content-type: multipart/alternative;
boundary="Boundary_(ID_Vlt8MRevijTkkThb1KbZ7Q)"

This is a multi-part message in MIME format.

--Boundary_(ID_Vlt8MRevijTkkThb1KbZ7Q)
Content-type: text/plain; charset=iso-8859-1
Content-transfer-encoding: 7BIT

I am just starting to get into object oriented programming to manipulate an Active Directory directory service. I was going through an O'Reilly book when I came across the section below. It says the connection is opened on behaf of the user running the script though we could have set soe other object properties to change that..Can anyone show me how?

Thanks,

Here's some code that displays the name of all of the groups to be found in a given domain. We'll go through this code piece by piece in a moment.

use Win32::OLE 'in';

# get ADO object, set the provider, open the connection
$c = Win32::OLE->new("ADODB.Connection");
$c->{Provider} = "ADsDSOObject";
$c->Open("ADSI Provider");
die Win32::OLE->LastError() if Win32::OLE->LastError( );

# prepare and then execute the query
$ADsPath = "LDAP://ldapserver/dc=example,dc=com";
$rs = $c->Execute("<$ADsPath>;(objectClass=Group);Name;SubTree");
die Win32::OLE->LastError() if Win32::OLE->LastError( );

until ($rs->EOF){
print $rs->Fields(0)->{Value},"\n";
$rs->MoveNext;
}

$rs->Close;
$c->Close;
The block of code after the module load gets an ADO Connection object instance sets that object instance's provider name, and then instructs it to open the connection. This connection is opened on behalf of the user running the script, though we could have set some other object properties to change this.



--Boundary_(ID_Vlt8MRevijTkkThb1KbZ7Q)
Content-type: text/html; charset=iso-8859-1
Content-transfer-encoding: 7BIT









I am just starting to get into object oriented programming to
manipulate an Active Directory directory service. I was going through an
O'Reilly book when I came across the section below. It says the connection is
opened on behaf of the user running the script though we could have set soe
other object properties to change that..Can anyone show me how?


Thanks,


Here's some code that displays the name of all of the
groups to be found in a given domain. We'll go through this code piece by piece
in a moment.


use Win32::OLE 'in';

# get ADO object, set the provider, open the connection
$c = Win32::OLE->new("ADODB.Connection");
$c->{Provider} = "ADsDSOObject";
$c->Open("ADSI Provider");
die Win32::OLE->LastError() if Win32::OLE->LastError( );

# prepare and then execute the query
$ADsPath = "LDAP://ldapserver/dc=example,dc=com";
$rs = $c->Execute("<$ADsPath>;(objectClass=Group);Name;SubTree");
die Win32::OLE->LastError() if Win32::OLE->LastError( );

until ($rs->EOF){
print $rs->Fields(0)->{Value},"\n";
$rs->MoveNext;
}

$rs->Close;
$c->Close;


The block of code after the module load gets an ADO
Connection object instance sets that object instance's provider name, and then
instructs it to open the connection. This connection is opened on behalf of the
user running the script, though we could have set some other object properties
to change this.


 



--Boundary_(ID_Vlt8MRevijTkkThb1KbZ7Q)--

--===============1214087460==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1214087460==--