Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: AD User Exist?

by VSarkiss (Monsignor)
on Nov 30, 2004 at 21:55 UTC ( #411309=note: print w/replies, xml ) Need Help??


in reply to AD User Exist?

A typical way to handle that are try/catch blocks, which in Perl are implemented with eval (the block form). When you wrap the call in an eval, it will trap the die, and let you inspect the result. Something like this in your case:

$path='cn=username,ou=mybase_ou,dc=computer,dc=com'; eval { $objUser = Win32::OLE->GetObject("LDAP://" . $path); }; if ($@) { # the call died, do something or another. }

You can read more about this in perlfunc, under eval.

Replies are listed 'Best First'.
Re^2: AD User Exist?
by Anonymous Monk on Dec 01, 2004 at 14:33 UTC
    Thank you, Eval worked perfectly.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (2)
As of 2022-01-29 10:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (74 votes). Check out past polls.

    Notices?