Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- use Net::LDAP;
- $ldap = Net::LDAP->new("smbpdc.home.net") or die "$@";
- my $dc = "dc=smbpdc,dc=home,dc=net";
- $mesg = $ldap->bind( "cn=Administrator,".$dc, password => "pa$$w0rd" );
- # Add new user
- $result = $ldap->add( "cn=John Doe,".$dc,
- attr => [ 'cn' => 'John Doe',
- 'sn' => 'Doe',
- 'givenName' => 'John',
- 'objectclass' => ['top', 'person', 'organizationalPerson', 'inetOrgPerson' ]
- ]
- );
- $result->error && warn "error: ", $result->error;
- $ldap->unbind;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement