From the Directory

by stephen mcgroarty 6/15/2010 8:54:57 PM

Sometimes it is easy to actually come up with content, other times not so much. This is one that it took a bit of finding but it was something I got stuck on.

How do you get the Active Directory Schema information without remote desktop/console access. Now there are other ways to do this, but i was looking for a simple console scripted method. NTDSUTIL has the power to do this via a simple script

First an example

C:\Documents and Settings\smcgroarty>ntdsutil
ntdsutil:

Notice that the command prompt, it will continue to change for each section that you are in

ntdsutil: domain management
domain management:
domain management: connection
server connections: connect to server DCSRV1
Binding to DCSRV1…
Connected to DCSRV1using credentials of locally logged in user.
server connections: quit
domain management: select operation target
select operation target: list roles for connected server
Server "DCSRV1" knows about 5 roles
Schema - CN=NTDS Settings,CN=DCSRV2,CN=Servers,CN=Sites,CN=Configuration,DC=velcrohurts,DC=com Domain - CN=NTDS Settings,CN=DCSRV2,CN=Servers,CN=Sites,CN=Configuration,DC=velcrohurts,DC=com
PDC - CN=NTDS Settings,CN=DCSRV2,CN=Servers,CN=Sites,CN=Configuration,DC=velcrohurts,DC=com
RID - CN=NTDS Settings,CN=DCSRV2,CN=Servers,CN=Sites,CN=Configuration,DC=velcrohurts,DC=com
Infrastructure - CN=NTDS Settings,CN=DCSRV2,CN=Servers,CN=Sites,CN=Configuration,DC=velcrohurts,DC=com
select operation target:

After you get the values, you need to type quit, for each step.
select operation target: quit
domain management: quit
nntdsutil: quit
C:\Documents and Settings\smcgroarty>

Now to put this in a simple batch file:
ntdsutil domain management connection connect to server DCSRV1 quit select operation target “list roles for connected server” quit quit quit

Thanks the quick and dirty of it, hope someone finds this useful

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , , ,

Weekly Tip

Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen
Hacked by Stephen McGroarty
Content © Stephen McGroarty


About the author

Stephen Mcgroarty - Avatar Stephen McGroarty

I am a Microsoft Certified Professional with Windows 2003 Server. I have a firm understanding of Linux, Windows, and everything needed for both workstation and servers.

E-mail me Send mail

Calendar

<<  February 2012  >>
SuMoTuWeThFrSa
2930311234
567891011
12131415161718
19202122232425
26272829123
45678910

View posts in large calendar

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2012