Jump to content

Query on Active Directory searches


Recommended Posts

Posted

I'm sure this is a dumb question, but it's puzzling me...

 

If you do a search for a user in Active Directory, and it finds the record, how can you tell whereabouts in the structure that entry is...? The only available fields for the search results seem to be things within the properties for the user, and not things about the container it's in...

Posted (edited)

This probably sounds harder than it is, but you can add an item to the right-click context menu for computer and user objects in ADUC which calls a 2-3 line script to pop-up a message box with the objects location. This is easy because the script is passed the object's distinguishedName ("cn=blah,ou=bike shed,ou=..") as an argument .. all it has to do is display that.

 

I've been doing more complex things around that, but I'm sure I've seen a little walk-through for just displaying the dn somewhere - will try and find it later.

 

Later: Can't find it, but here's one for restarting computers which is close enough - just substitute a tiny script to display WScript.Arguments(0) and add the context menu item to user objects as well.

 

Oddvar Håland Moe's blog

Edited by PiqueABoo
Posted (edited)
Thanks for all the suggestions. I hadn't spotted that you can get the info from the Object tab of the item's properties window...:) Edited by BJG
Posted (edited)
I'm sure this is a dumb question, but it's puzzling me...

 

If you do a search for a user in Active Directory, and it finds the record, how can you tell whereabouts in the structure that entry is...? The only available fields for the search results seem to be things within the properties for the user, and not things about the container it's in...

 

Firstly, you can do it all via the scripts that have been quoted, but you can also do it direct in the Users and computers plugin you are currently using.

 

Firstly (before you find anything) make sure that the "Advanced Features" is ticked (it is in the view menu). This will create a few extra tabs on the properties box.

 

One of these tabs is titled "Object". This contains the canonical name of the object, which is effectively the location.

 

Obviously if you want the "Advanced Features" to stay ticked, then you have to enable the save changes mode in the MMC... but that is another story!

 

I hope this helps

 

Jonathan

P.S. Sorry for duplicating what was said earlier - I could have sworn that they were not there when I looked!

Edited by ArchersIT
Read to the end of thread and discovered I was duplicating.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...