Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/perl/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
未知OU时Perl中的LDAP绑定_Perl_Active Directory_Ldap - Fatal编程技术网

未知OU时Perl中的LDAP绑定

未知OU时Perl中的LDAP绑定,perl,active-directory,ldap,Perl,Active Directory,Ldap,是否有一种方法可以成功绑定,同时在绑定搜索基字符串中省略其中一个文件?我并不总是知道$site对用户来说是什么,如果我不使用它,绑定就会失败。我能要些像OU=* $ldapSearchBase = "OU=$site,OU=xxxx,OU=xxxx,DC=$globalLocation,DC=companyName,DC=com"; 如果我离开了网站,我会得到。如果我把它放在正确的站点上,它就会工作 The wrong password was supplied or the SASL cr

是否有一种方法可以成功绑定,同时在绑定搜索基字符串中省略其中一个文件?我并不总是知道$site对用户来说是什么,如果我不使用它,绑定就会失败。我能要些像OU=*

 $ldapSearchBase = "OU=$site,OU=xxxx,OU=xxxx,DC=$globalLocation,DC=companyName,DC=com";
如果我离开了网站,我会得到。如果我把它放在正确的站点上,它就会工作

The wrong password was supplied or the SASL credentials could not be processed

使用第一个容器作为搜索基础:

$ldapSearchBase = "DC=$globalLocation,DC=companyName,DC=com";

LDAP绑定要求您有一个唯一的可分辨名称加上适当的凭据(用户/密码、SSL等)。如果DN不唯一,则绑定将始终失败

您可能希望尝试拆分基本DN并改变
$site
中的任何内容:

my $ldapSearchBase = "OU=user,OU=accounts,DC=$globalLocation,DC=companyName,DC=com";
my $ldapSite = "OU=$site";
my $bindString = $ldapSearch . "," . $ldapSearchBase;