Guys,

Small question.
We have a project that requires us to get the full name for each user in a specific OU. The OU is variable and we need to specify 7 (for now) separate OU’s one by one or in an array that is to be determined later on. But that is not the problem

I got the script below that works for me but it is VBS. Tried to convert it to kix but no success, maybe because of my very very low VBS knowledge

Can this be converted to kix in some way or is it just impossible?

 Code:
On Error Resume Next

Const ADS_SCOPE_SUBTREE = 2

Set objConnection = CreateObject("ADODB.Connection")
Set objCommand = CreateObject("ADODB.Command")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
Set objCommand.ActiveConnection = objConnection

objCommand.Properties("Page Size") = 1000
objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE 

objCommand.CommandText = _
"SELECT Name FROM 'LDAP://ou=some_ou,dc=subdomain,dc=domain,dc=tld' WHERE objectCategory='user'"  
Set objRecordSet = objCommand.Execute

objRecordSet.MoveFirst
Do Until objRecordSet.EOF
	WScript.Echo objRecordSet.Fields("Name").Value
	objRecordSet.MoveNext
Loop
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.