I am unable to utilize the filter method when working with ADSI objects. I'm not sure if this is a KiX limitation or if the syntax is slightly different then from VB. Here's how it works in VB (and I've looked at dozens of script to make sure this is the absolute correct way)...
code:
Set NTDomain = GetObject("WinNT://YourDomainName")
NTDomain.Filter = Array("User")
userlist = "User List: " & vbCrLf
for each usr in NTDomain
userlist = userlist & usr.name & vbCrLf
next
This code prevents groups and computers from being returned when all items are enumerated. However, when I try to use the .filter method in a KiX script it never filters anything. I don't get an error, and I can even use really bad syntax and it still won't return an error. This is leading me to believe that for whatever reason KiX is not supporting the .filter method. Here's some code I am trying to use...
code:
BREAK ON
$adsDomain = GetObject("WinNT://@LDOMAIN,Domain")
$adsDomain.Filter = Array("User")
FOR EACH $ELEMENT IN $adsDomain
? $ELEMENT.NAME + " : " + $ELEMENT.CLASS
NEXT
$adsDomain = Nothing
Anyone have any insight on this?
-Ben
http://www.rgcweb.org/kix