Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Problems doing ldap query on a child domain with enterprise administrator access.

Posted on 2006-11-27
2
Medium Priority
?
2,312 Views
Last Modified: 2008-01-09
I have a problem between 2 domains.  For simplicty, let's call the root domain ROOT.COM, and lets call the child of the root domain CHILD.ROOT.COM.

When I log in as ROOT\Administrator that is a part of the enterprise Administrators group to both ROOT.COM and CHILD.ROOT.COM I definitely have all the rights to all the objects in the root domain and the child domain.  But, when I'm logged in as root\Administrator on the domain controller of child.root.com, and I run an application that does an ldap query of an object inside CHILD.ROOT.COM it fails.

For example: When I'm logged in as ROOT\Administrator (member of Enterprise Administrators), logged into the domain controller CHILD.DOMAIN.COM

        strLDAPQuery = "<LDAP://DC=CHILD,DC=ROOT,DC=COM>;" & "(sAMAccountName=CHILD$);distinguishedName;" & "subtree"

As you can see, I'm trying to get the distinguishedName of the domain controller that I'm logged into.  Why doesn't this work?  When I log into the domain controller CHILD.DOMAIN.COM as CHILD/Administrator, the query works fine.

Some additional information and conditions:
-ROOT.COM is a Windows 2003 Domain running in mixed mode (and going to native is not an option, and not sure if it matters)
-I do not want to resort querying the root domain (ROOT.COM) to query objects in the child domains because of its inefficient nature, and the fact that the entire domain could have close to a million objects, and objects with identical sAMAccountNames in different domains.
-I do not want to specify a seperate username and password while making the query.  I want the service to be able to make the query using its own credentials its running with.

The ultimate goal is to run a service on all domain controllers using a single service account, and this service account needs to be able to make ldap queries on all domains of this forest from the domain controller that is running this service.

I think I might have the answer already, which has something to do with changing the dsHeuristics value for each domain, but I do not like the implementation steps for it because of the number of domains we have, and the fact that it sounds like I'm opening up a bigger security hole than needed for what needs to get accomplished makes me wonder if there is a better way, or maybe I'm just overlooking something, or a better way to implement it?  Thanks for your help!
0
Comment
Question by:LFMIKE
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 51

Accepted Solution

by:
Netman66 earned 1500 total points
ID: 18024058
Is the zone _msdcs.domain.com AND _msdcs.child.domain.com on the Child's DNS server?

Are those zones at the top level with the child.domain.com zone?

Does that query run from ADUC Saved Queries?

0
 

Author Comment

by:LFMIKE
ID: 18025162
Netman66,
The Child does not have a DNS server. Maybe that would have helped the problem, but I found a solution that doesn't require any changes to the dns.

Just want to share the solution with people that find this that might be interested.  I personally wasn't aware, but if you run a ldap getrootdse and get defaultnamingcontext, you are not getting the defaultnamingcontext of the domain controller you're logged onto, you are getting the defaultnamingcontext of the user you're logged on as.  with or without the dns server, (i have to mention i have not done any tests outside of what is stated) it looks like you can query any parent or child domain from at least the domain controller, logged in as any domain administrator to any domain in the tree.  but you must specify the right domain name, and then the right base string.

For example: logged in as ROOT\Administrator or CHILD\Administrator
These were successful
<LDAP:\\root.com\dc=root,dc=com>
<LDAP:\\child.root.com\dc=child,dc=root,dc=com>
You can also specify FQDN of the server to hit a specific server for the query.

These were NOT successful
<LDAP:\\root.com\dc=child,dc=root,dc=com>
<LDAP:\\child.root.com\dc=root,dc=com>

Here is the interesting part
<LDAP:\\dc=child,dc=root,dc=com> did not work while logged in as ROOT\Administrator on the CHILD.ROOT.COM domain controller, but it worked while logged in as CHILD\Administrator.

The bottom line, always specify the fqdn of the domain or domain controller you're querying, and make sure your base DN corresponds to the domain the domain controller is running.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

So you have two Windows Servers and you have a directory/folder/files on one that you'd like to mirror to the other?  You don't really want to deal with DFS or a 3rd party solution like Doubletake. You can use Robocopy from the Windows Server 200…
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question