September 2003
Intermediate to advanced
624 pages
15h 49m
English
You want to view the mandatory and optional attributes of a class.
Open the Active Directory Schema snap-in.
In the left pane, click on the Classes folder.
In the right pane, double-click the class you want to view.
Click on the Attributes tab.
> dsquery * cn=<ClassCommonName>,cn=schema,cn=configuration,<ForestRootDN> -l[RETURN] -scope base -attr mayContain mustContain systemMayContain systemMustContain
' This code displays the mandatory and optional attributes for a class.
' ------ SCRIPT CONFIGURATION ------
' Set to common name of class to view
strClassName = "<ClassCommonName>" ' e.g. Surname ' ------ END CONFIGURATION --------- set objRootDSE = GetObject("LDAP://RootDSE") set objClass = GetObject("LDAP://cn=" & strClassName & "," & _ objRootDSE.Get("schemaNamingContext")) WScript.Echo "Class: " & strClassName & vbCrlf ' Need to enable this so that if an attribute is not set, it won't die on error resume next WScript.Echo "mayContain:" for each strVal in objClass.Get("mayContain") WScript.Echo vbTab & strVal next WScript.Echo vbCrlf & "systemMayContain:" for each strVal in objClass.Get("systemMayContain") WScript.Echo vbTab & strVal next WScript.Echo vbCrlf & "mustContain:" for each strVal in objClass.Get("mustContain") WScript.Echo vbTab & strVal next WScript.Echo vbCrlf & "systemMustContain:" for each strVal in objClass.Get("systemMustContain") ...