Solved

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

Posted on 2006-11-27
2
2,102 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
2 Comments
 
LVL 51

Accepted Solution

by:
Netman66 earned 500 total points
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

I have never ceased to be amazed how many problems you can encounter on a fresh install of a Windows operating system.  This is certainly case in point& Unable to complete ANY MSI installation.  This means Windows Updates are failing and I can't …
This may not be a text book method to resolve VSS backup issues but it seemed to have worked on few of the Windows 2003 servers we had issues while performing a Volume Shadow Copy backup. If you have issues while performing a shadow copy backup usin…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now