ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl-win32-admin
perl-win32-admin
getting user attributes in perl
by Rich Gomes other posts by this author
Mar 4 2009 2:01PM messages near this date
view in the new Beta List Site
Re: PERL Script Debugging | Paul J Walters/Rochester/IBM is out of the office.
I have a script which returns all users in my domain. It works great but I want a way to ret
rieve additional attributes like 'manager' or 'mail'.
Is there a way to do this using Win32::OLE?


Script follows:


use Win32::OLE 'in';
$ADsPath = "WinNT://mydomain/adomaincontroller";
$c = Win32::OLE-> GetObject($ADsPath) or warn "Unable to get $ADsPath\n";
foreach $adsobj (in$c) {
print $adsobj-> {Name},"\n" if ($adsobj->{Class} eq "User")
}


Thanks in advance

Rich

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved