Skip to Content
Active Directory Cookbook
book

Active Directory Cookbook

by Robbie Allen
September 2003
Intermediate to advanced
624 pages
15h 49m
English
O'Reilly Media, Inc.
Content preview from Active Directory Cookbook

11.23. Listing the Connection Objects for a Server

Problem

You want to view the connection objects associated with a domain controller.

Solution

Using a graphical user interface

  1. Open the Active Directory Sites and Services snap-in.

  2. In the left pane, expand Sites, expand the site that contains the connection object you want to check, expand the Servers container, expand the server that contains the connection object, and click on the NTDS Settings object.

  3. In the right pane, under the name column, it will display which connection objects are automatically generated (by the KCC) and which ones were manually generated.

Using a command-line interface

> repadmin /showconn [<DomainControllerName>]

Using VBScript

' This code lists the connection objects for a server
' ------ SCRIPT CONFIGURATION ------
strServer = "<ServerName>"  ' e.g. dc01
strSite   = "<SiteName>"    ' e.g. MySite1
' ------ END CONFIGURATION ---------

set objRootDSE = GetObject("LDAP://RootDSE")
set objNTDSCont = GetObject("LDAP://cn=NTDS Settings,cn=" & strServer & _
                            ",cn=servers,cn=" & strSite & ",cn=sites," & _
                             objRootDSE.Get("configurationNamingContext") )
objNTDSCont.Filter = Array("ntdsConnection")
WScript.Echo "Connection objects for " & strSite & "\" & strServer
for each objConn in objNTDSCont
   if objConn.Get("options") = 0 then
      Wscript.Echo "  " & objConn.Get("cn") & " (MANUAL)"
   else
      Wscript.Echo "  " & objConn.Get("cn") & " (AUTO)"
   end if
next

Tip

Another option for programmatically getting the connection objects for a server ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Active Directory Administration Cookbook

Active Directory Administration Cookbook

Sander Berkouwer
Active Directory Cookbook, 3rd Edition

Active Directory Cookbook, 3rd Edition

Laura E. Hunter, Robbie Allen
Active Directory Cookbook, 4th Edition

Active Directory Cookbook, 4th Edition

Brian Svidergol, Robbie Allen

Publisher Resources

ISBN: 0596004648Supplemental ContentCatalog PageErrata