目的は、Active Directoryサーバー内のすべてのコンピュータの "dn"属性を取得することです。 "000004DC:LdapErr:DSID-0C090752、コメント:この操作を実行するには、接続で正常なバインドを完了する必要があります。"私は成功を収めて直接ドメインにログインするためのユーザ名/パスワードをテストしてみた「000004DC:LdapErr:DSID-0C090752」を取得しています。 Net :: LDAPを使用してperlでバインドを実行する場合
#!/usr/bin/perl
use strict;
use Net::LDAP;
use Data::Dumper;
my $ldap = Net::LDAP->new('my.domain.com') or die [email protected];
my $user = 'CN=username,OU=orgname,DC=my,DC=domain,DC=com';
my $pass = 'my_password';
$ldap->bind($user, password => $pass);
#$ldap->bind;
my $mesg = $ldap->search(
base => "DC=my,DC=domain,DC=com",
filter => "ObjectClass=Computers",
attrs => "dn"
);
:
は、ここに私のコードです。私は、スクリプトの最後にこれを追加する場合 追加情報:このスクリプトの作業を取得する方法についてprint Dumper($mesg);
$VAR1 = bless({
'parent' => bless({
'net_ldap_version' => 3,
'net_ldap_scheme' => 'ldap',
'net_ldap_debug' => 0,
'net_ldap_socket' => bless(\*Symbol::GEN0, 'IO::Socket::INET'),
'net_ldap_host' => 'my.domain.com',
'net_ldap_uri' => 'my.domain.com',
'net_ldap_resp' => {},
'net_ldap_mesg' => {},
'net_ldap_async' => 0,
'net_ldap_port' => 389,
'net_ldap_refcnt' => 1
}, 'Net::LDAP'),
'errorMessage' => '000004DC: LdapErr: DSID-0C090752, comment: In order to perform this operation a successful bind must be completed on the connection., data 0, v2580',
'ctrl_hash' => undef,
'resultCode' => 1,
'callback' => undef,
'mesgid' => 2,
'matchedDN' => '',
'controls' => undef,
'raw' => undef
}, 'Net::LDAP::Search');
任意の提案は、私が探しているものです。 ありがとう!
バインドに失敗しています。知っているから仕事のツールからLDAPを使ってバインドしてみてください。 (私はApache Studioが好きです) – jwilleke
@jwillekeこのUnixサーバにソフトウェアを追加することができないので、Perl Net :: LDAPソフトウェアはすでにマシンにインストールされています。別のWindowsワークステーションのドメインにログインして、アカウントのユーザー名とパスワードを確認しました。 バインドに失敗しましたが、私はDCからの理由を得ていないので、次に何を試していいのか分かりません。 – scryptKiddy
試してみてください:http://ldapwiki.com/wiki/Determining%20the%20FDNと私は、LDAPリターンコードを表示する既知の優れたLDAPクライアント(私はApache Studioを使用しています)を使用することをお勧めします。 http://ldapwiki.com/wiki/Common%20Active%20Directory%20Bind%20Errors – jwilleke