This was requested in another thread.


Function EnumObjProps($object)
Dim $Class, $Schema, $Value, $property, $cont

$Class = GetObject($object.schema)
? "Class: " + $Class.Name
? "GUID: " + $Class.GUID
? "Implemented by: " + $Class.CLSID

If $Class.Container
? ? "Container Object"
? "Class Contains:"
For Each $cont In $Class.Containment
? " " + $cont
Next
Else
? ? "Leaf Object"
EndIf

? "Mandatory Properties in this Class: "
For Each $property In $Class.MandatoryProperties
? " " + $property
Next

? ? "Optional Properties in this Class: "
For Each $property In $Class.OptionalProperties
? " " + $property
Next
EndFunction



Examples:
$A = GetObject("WinNT://myComputer,computer")
EnumObjProps($A)

$A = GetObject("WinNT://myDomain/user1,user")
EnumObjProps($A)

$A = GetObject("LDAP://us-tyco-e/CN=BULLOCKHA,OU=test,OU=9826,OU=NCS,OU=Machines,DC=us,DC=tycoelectronics,DC=com")
EnumObjProps($A)

{edit}
I removed the getting and printing of property values since some datatypes cause script failures.


[ 25. July 2003, 23:34: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/