Make sure you import the in function from the Win32::OLE module, then
you can do something like this:

###############################

use strict;
use warnings;
use Win32::OLE qw(in);

my $obj = Win32::OLE->GetObject("LDAP://server/OU=MyOU,DC=company,DC=com
") || die;
$obj->{Filter} = ["User"];
foreach( in($obj) ){
  print "$_->{sAMAccountName}\n";
}

###############################

It's unfortunate that there aren't more code samples out there, because
it's really pretty easy once you know how.

-----Original Message-----
From: Ronen Kfir [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 01, 2004 2:50 AM
To: [EMAIL PROTECTED]
Subject: WIN2K Active Directory qtn. execute system command with login
script.

Hi,
I have a command line tool (tscmd), which works fine on single user. My
goal is to change TS profile for Organization Unit user. I want to put a
login script inside a GPO of this OU in order to do it.
What I miss is how to create the array of users included in this
Organization Unit, so I can run on this list with my command through
foreach loop.
Please help!

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to