#!/usr/bin/perl -w use strict; use Net::LDAP; my $server = '192.168.56.110'; my $port = '389'; my $c = Net::LDAP->new('ldaps://192.168.56.110') or die "Unable to connect to $server: $@\n"; my $binddn = "cn=Administrator,cn=users,dc=example,dc=com"; my $passwd = "!l3s0123"; my $mesg = $c->bind($binddn, password => $passwd); die 'Unable to bind: ' . $mesg->error . "\n" if $mesg->code; $c->unbind;