Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re^3: PERL en ADSI

by SuicideJunkie (Priest)
on Jan 11, 2011 at 14:07 UTC ( #881669=note: print w/ replies, xml ) Need Help??

in reply to Re^2: PERL en ADSI
in thread PERL en ADSI



use strict; use warnings;
To the top of that code, and Perl will tell you what is technically wrong and help get the code to run.

You will save yourself from a million headaches if you use those liberally.

A quick look through the Win32::OLE description indicates that your code probably won't compile because "in" isn't exported by default. You probably want to add that and anything else you want to use to your use statements up top.

Comment on Re^3: PERL en ADSI
Select or Download Code
Re^4: PERL en ADSI
by PerlUserNL (Initiate) on Jan 11, 2011 at 14:37 UTC
    use strict; use warnings; use Win32::OLE; $ou=Win32::OLE->GetObject("LDAP://ou=Users,dc=myDomain,dc=net"); @filter=("user"); $ou->{filter}=\@filter; foreach $obj (in $ou){ print "$obj->{name}\n"; }

    I add the strict en warnings by default in my scripts, But i forgot to posted it here...

      This code cannot compile. Please show some effort and eliminate the most obvious errors before posting.

      corion is correct, this code won't work at all. Perhaps you want to look at a working LDAP / Active Directory example: Help using Win32::OLE

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://881669]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (10)
As of 2015-05-22 15:52 GMT
Find Nodes?
    Voting Booth?

    In my home, the TV remote control is ...

    Results (460 votes), past polls