Bookmarks

Yahoo Gmail Google Facebook Delicious Twitter Reddit Stumpleupon Myspace Digg

Search queries

Use of assignment to $[ is deprecated at /usr/local/sbin/apxs line 86. , wwwxxx vim, mysql closing table and opening table, 800c5000, setgid operation not permitted, pciehp: acpi_pciehprm on IBM, WWWXXX.DBF, 078274121, info0a ip, should prodicers of software_based services be held liable or not liable for economic injuries

Links

XODOX
Impressum

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

Posted on 2006-01-25 03:37:58 by 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

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2802" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial>
<P><FONT size=2>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?</FONT></P>
<P><FONT size=2>Thanks,</FONT></P>
<P><STRONG><FONT size=2>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.</FONT></STRONG></P>
<BLOCKQUOTE><PRE class=programlisting><STRONG><FONT size=2>use Win32::OLE 'in';

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

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

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

$rs-&gt;Close;
$c-&gt;Close;</FONT></STRONG><A name=INDEX-648></A>
</PRE></BLOCKQUOTE>
<P><STRONG><FONT size=2>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.</FONT></STRONG></P>
<P><STRONG><FONT size=2></FONT></STRONG>&nbsp;</P></FONT></DIV></BODY></HTML>

--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==--

Report this message