10.10. Viewing a Class

Problem

You want to view the attributes of a class.

Solution

Using a graphical user interface

  1. Open the Active Directory Schema snap-in.

  2. In the left pane, click on the Classes folder.

  3. In the right pane, double-click the class you want to view.

  4. Click on each tab to view the available properties.

Using a command-line interface

In the following command, replace <ClassCommonName> with the common name (not LDAP display name) of the class you want to view:

> dsquery * cn=<ClassCommonName>,cn=schema,cn=configuration,<ForestRootDN> -scope[RETURN]
base -attr *

Using VBScript

' This code prints out the attributes for the specified class.
' Recipe 4.2 for the code for the DisplayAttributes( ) function.
' ------ SCRIPT CONFIGURATION ------
' Set to the common name (not LDAP display dame) 
' of the class you want to view. 
strClassName = "<ClassCommonName>"   ' e.g. user
' ------ END CONFIGURATION ---------

set objRootDSE = GetObject("LDAP://RootDSE")
set objClass = GetObject("LDAP://cn=" & strClassName & "," & _
                         objRootDSE.Get("schemaNamingContext"))
objClass.GetInfo
WScript.Echo "Properties for " & strClassName
DisplayAttributes(objClass.ADsPath)

Discussion

See Table 10-1 for a list of the important classSchema attributes and their descriptions.

See Also

Recipe 4.2 for viewing the attributes of an object

Get Active Directory Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.