my $rootDseQueryString = "LDAP://RootDSE"; if ("" ne $domain) { $rootDseQueryString = "LDAP://".$domain."/RootDSE"; } print $rootDseQueryString."\n"; my $RootDSE = Win32::OLE->GetObject($rootDseQueryString); #### my $rootDseQueryString = "RootDSE"; if ("" ne $domain) { $rootDseQueryString = $domain."/RootDSE"; } print $rootDseQueryString."\n"; my $ldap_server = $rootDseQueryString; $ldap = Net::LDAP->new($ldap_server) or die $@;