10.17.1 ProblemYou want to list the structural, auxiliary, abstract, and 88 classes. 10.17.2 Solution10.17.2.1 Using a graphical user interface
10.17.2.2 Using a command-line interface> dsquery * cn=schema,cn=configuration,<ForestRootDN> -limit 0 -scope onelevel[RETURN] -filter "(objectcategory=classSchema)" -attr lDAPDisplayName objectclasscategory 10.17.2.3 Using VBScript' This code prints out classes of a particular type ' ------ SCRIPT CONFIGURATION ------ ' Set the following to TRUE or FALSE depending if you want to ' view or not view classes of the type defined by the variable boolShowStructural = TRUE boolShowAuxiliary = TRUE boolShowAbstract = TRUE boolShow88 = TRUE ' ------ END CONFIGURATION --------- set objRootDSE = GetObject("LDAP://RootDSE") set objSchemaCont = GetObject("LDAP://cn=schema," & _ objRootDSE.Get("configurationNamingContext")) objSchemaCont.Filter = Array("classSchema") WScript.Echo "Loading classes, this will take a few seconds." for each objClass in objSchemaCont WScript.StdOut.Write(".") if objClass.Get("objectClassCategory") = 0 then str88 = str88 & vbTab & objClass.Get("lDAPDisplayName") & vbCrlf elseif objClass.Get("objectClassCategory") = 1 then strStruct = strStruct & vbTab & _ objClass.Get("lDAPDisplayName") & vbCrlf elseif objClass.Get("objectClassCategory") = 2 then strAbst = strAbst & vbTab & objClass.Get("lDAPDisplayName") & vbCrlf elseif objClass.Get("objectClassCategory") = 3 then strAux = strAux & vbTab & objClass.Get("lDAPDisplayName") & vbCrlf else WScript.Echo "Unknown class type: " & _ objClass.Get("lDAPDisplayName") & vbCrlf end if next WScript.Echo vbCrlf if boolShowStructural = TRUE then WScript.Echo "Structural Classes: " WScript.Echo strStruct WScript.Echo end if if boolShowAbstract = TRUE then WScript.Echo "Abstract Classes: " WScript.Echo strAbst WScript.Echo end if if boolShowAuxiliary = TRUE then WScript.Echo "Auxiliary Classes: " WScript.Echo strAux WScript.Echo end if if boolShow88 = TRUE then WScript.Echo "88 Classes: " WScript.Echo str88 WScript.Echo end if 10.17.3 DiscussionThere are four supported class types in the Active Directory schema. The class type is defined by the objectClassCategory attribute on classSchema objects. Each class type is used for a different purpose relating to organizing and inheriting classes. Table 10-6 describes each type.
|