I think I have uncovered some pertinent data regarding the perceived ADSI filter issue where computers are returned when the FILTER is set to "user" as seen in thread:

http://www.kixtart.org/board/ultimatebb.php?ubb=get_topic;f=1;t=007184;p=1#000009

Using an alternative method (ADODB) to query the "users" from Active Directory I have discovered that an object seems to have an array of CLASS attributes. A user has shows these class attributes: top person organizationalPerson user while a computer object has these: top person organizationalPerson user computer.

With the above info I can see why ADSI is returning both users and computers when the FILTER is set to "user".

You can gather your own data with the following code.


$oConnection1 = CreateObject("ADODB.Connection")
$oCommand1 = CreateObject("ADODB.Command")

; Open the connection.
$oConnection1.Provider = "ADsDSOObject" ; This is the ADSI OLE-DB provider name
$oConnection1.Open ("Active Directory Provider")

; Create a command object for this connection.
$oCommand1.ActiveConnection = $oConnection1

; Compose a search string.
$oCommand1.CommandText = "select name, objectClass from 'LDAP://NetBIOSDomainName/DC=DNSDomainName, DC=com' " +
"WHERE objectClass='user'"

; Execute the query.
$rs = $oCommand1.Execute
? "exexcute: @error @serror"

;--------------------------------------
; Navigate the record set
;--------------------------------------

While (Not $rs.EOF)
for each $item in $rs.Fields
? $item.Name + " = "
$Value = $item.Value
if VarTypeName($Value) = "String"
" " + $Value
else
for each $v in $Value
" " + $v
next
endif
next
$rs.MoveNext
Loop


[ 17. May 2003, 03:55: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/