Bryce:

Unfortunately, the only answer I can give is our old standby:

It all depends ( on the object, that is )

Different objects have different properties, methods and subobjects.

For example, WinNT: contains domain objects. WinNT://mydomain contains domain properties, users, groups, computers and a schema object. WinNT/mydomain/myuser contains user properties and groups.

Again, in terms of domain enumeration:

code:

break on


$domainName = "development"


$domain = olegetobject ( 0, "WinNT://$domainName" )
if $domain = 0
"Active Data Services Interface (ADSI) not installed on this machine"
exit
endif


?
?"Domain Properties:"
?
?"DomainName " olegetproperty ( $domain, "Name" )
?"IsWorkgroup " olegetproperty ( $domain, "IsWorkgroup" )
?"MinPasswordLength " olegetproperty ( $domain, "MinPasswordLength" )
?"MinPasswordAge " olegetproperty ( $domain, "MinPasswordAge" )
?"MaxPasswordAge " olegetproperty ( $domain, "MaxPasswordAge" )
?"MaxBadPasswordsAllowed " olegetproperty ( $domain, "MaxBadPasswordsAllowed" )
?"PasswordHistoryLength " olegetproperty ( $domain, "PasswordHistoryLength" )
?"PasswordAttributes " olegetproperty ( $domain, "PasswordAttributes" )
?"AutoUnlockInterval " olegetproperty ( $domain, "AutoUnlockInterval" )
?"LockoutObservationInterval " olegetproperty ( $domain, "LockoutObservationInterval" )
?

$objects = oleenumobject ( $domain )

$object = oleenumobject ( $domain, $objects )

$count = 0
$userCount = 0
$groupCount = 0
$computerCount = 0
$schemaCount = 0
$unknownCount = 0


?"Domain Objects:"
?


while $object <> 0


$class = olegetproperty ( $object, "class" )
$count = $count + 1


select
case $class = "user"
$userCount = $userCount + 1
case $class = "group"
$groupCount = $groupCount + 1
case $class = "computer"
$computerCount = $computerCount + 1
case $class = "schema"
$schemaCount = $schemaCount + 1
case 1
$unknownCount = $unknownCount + 1
endselect


$rs = olereleaseobject ( $object )
$object = oleenumobject ( $domain, $objects )


loop


?"Users $userCount"
?"Groups $groupCount"
?"Computers $computerCount"
?"Schemas $schemaCount"
?"Unknowns $unknownCount"
?"Total $count"


if $objects
$rs = olereleaseobject ( $objects )
endif


if $domain
$rs = olereleaseobject ( $domain )
endif


?

exit


This topic is so large that we'd probably need a seperate forum on this BBS to discuss all the permutations and applications of ADSI.

As well, I think what would be usefull is some kind of object browser script that would enumerate all the properties, methods and subobjects of any given ADSI object.

Then it's just a matter of understanding the KiX OLE syntax and it's off to the races.

Shawn.

[This message has been edited by Shawn (edited 14 August 2000).]