Thursday, October 04, 2007

Finding your Active Directory server when extending TFS for Alerts

This is only somewhat related to TFS, but I wanted to document it anyways for my future reference. Because TFS RTM 1.0 Alerts stink, we wrote our own notification server. It simply looks at each work item change and if the "Assigned To" changes it uses the "displayName" (e.g. LastName, FirstName (Company)) to do a look up in Active Directory and find the user's email address.

In a posting way back - where I share all the things we dislike about TFS - I describe how we're using Mariano Szklanny's solution.

Anyway, I wanted to do some browsing in the Active Directory tree to see what other information we could get back, but I couldn't find the DNS to connect my LDAP browser. After digging around for an hour, I kind of found it here on Microsoft's page.

I'm not sure if this is right, but basically all I did is run the "nslookup" command and it gave me back the domain controller (I think that is what it gave me) and I was able to connect to Active Directory and get what I needed.

Again, I'm not sure if this is the best way, but it seems to work for us.


Martin Woodward said...

Hey Mac.

The reason that worked for you is that Windows Machines part of an active directory network often have DNS configured so that the primary DNS server also happens to be the active directory server for you domain. Typing "nslookup" displays the current primary DNS server - you can get the same information by doing an ipconfig /all

Windows client machines use DNS to locate their domain controller (or the domain controller for other domains) - if you are interested in the gory details see

I'd be interested in hearing more about your alert mechanism some time. If you get change to elaborate that I'd love to know.



Mac Noland said...

Thanks Martin! If I'm understanding you right, because our DNS server is also acting as our AD server, this worked for me. If our setup was different - that is with the AD server someplace else - this would not work.

So let me ask you this, how do you find your AD server name if it's not hosted on the DNS server?

Also, yes I'll try to post some more details on our Notification Server. It's working pretty well for us.

Scooter said...

You could have walked over two cubes and asked - I have a little app I used to ping AD to see who owns what software in the company.