Sign in to follow this  
Followers 0
erezlevi

translation from vb to auto-it

8 posts in this topic

can someone translate this for me:

' Find first names of all the zar....

Set pLDAP = CreateObject("LDAPClient.3")
Call pLDAP.Connect("9.17.186.253")

Set pAttributeNames = CreateObject("LDAPClient.StringCollection")
Call pAttributeNames.Add("givenName")
Call pAttributeNames.Add("mail")

' Find all the zar... family names...
Set pEntries = pLDAP.Search("c=il,ou=bluepages,o=ibm.com", "sn=zar*", , pAttributeNames)
For Each pEntry In pEntries
    MsgBox pEntry.Attributes("givenName").Values(0).Value
    MsgBox pEntry.Attributes("mail").Values(0).Value
Next

Share this post


Link to post
Share on other sites



bump ?

Share this post


Link to post
Share on other sites

second bump.

Share this post


Link to post
Share on other sites

Try this, I havn't tested it.

$pLDAP = ObjCreate("LDAPClient.3")
$pLDAP.Connect("9.17.186.253")

$pAttributeNames = ObjCreate("LDAPClient.StringCollection")
$pAttributeNames.Add("givenName")
$pAttributeNames.Add("mail")

; Find all the zar... family names...
$pEntries = $pLDAP.Search("c=il,ou=bluepages,o=ibm.com", "sn=zar*", "", $pAttributeNames)
For $pEntry In $pEntries
    MsgBox(0, "", $pEntry.Attributes("givenName").Values(0).Value)
    MsgBox(0, "", $pEntry.Attributes("mail").Values(0).Value)
Next

Share this post


Link to post
Share on other sites

didn't someone make a vb to autoit converter in example scripts?


Giggity

Share this post


Link to post
Share on other sites

Try this, I havn't tested it.

$pLDAP = ObjCreate("LDAPClient.3")
$pLDAP.Connect("9.17.186.253")

$pAttributeNames = ObjCreate("LDAPClient.StringCollection")
$pAttributeNames.Add("givenName")
$pAttributeNames.Add("mail")

; Find all the zar... family names...
$pEntries = $pLDAP.Search("c=il,ou=bluepages,o=ibm.com", "sn=zar*", "", $pAttributeNames)
For $pEntry In $pEntries
    MsgBox(0, "", $pEntry.Attributes("givenName").Values(0).Value)
    MsgBox(0, "", $pEntry.Attributes("mail").Values(0).Value)
Next

don't work... anyone else?

Share this post


Link to post
Share on other sites

There is nothing wrong with Pain's script. The most likely issue is due to the "$pLDAP.Search" function call's third parameter. Since we have know no knowledge of what the possible values can be you will need to change that part yourself.


--- TTFN

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

There is nothing wrong with Pain's script. The most likely issue is due to the "$pLDAP.Search" function call's third parameter. Since we have know no knowledge of what the possible values can be you will need to change that part yourself.

you are right! finally a brave one!!!!

here is the solution:

and I admit I was wrong!!!!!!

$pLDAP = ObjCreate("LDAPClient.3")
$pLDAP.Connect("9.17.186.253")
; Find all the za... family names...
$pEntries = $pLDAP.Search("c=il,ou=bluepages,o=ibm.com", "sn=zar*") 

MsgBox(0, "", $pEntries.Count)
For $pEntry In $pEntries
    MsgBox(0, "", $pEntry.Attributes("givenName").Values(0).Value)
    MsgBox(0, "", $pEntry.Attributes("mail").Values(0).Value)
    MsgBox(0, "", $pEntry.Attributes("sn").Values(0).Value)
Next

that will show you all attributes.

this will give only the attributes you want:

$pLDAP = ObjCreate("LDAPClient.3")
$pLDAP.Connect("9.17.186.253")

$Scope = 2  ;axldapScopeSubTree 

$pAttributeNames = ObjCreate("LDAPClient.StringCollection")
$pAttributeNames.Add("givenName")
$pAttributeNames.Add("mail")

; Find all the co... family names...
$pEntries = $pLDAP.Search("c=il,ou=bluepages,o=ibm.com", "sn=co*", $Scope , $pAttributeNames)

MsgBox(0, "", $pEntries.Count)
For $pEntry In $pEntries
    MsgBox(0, "", $pEntry.Attributes("givenName").Values(0).Value)
    MsgBox(0, "", $pEntry.Attributes("mail").Values(0).Value)
Next
Edited by erezlevi

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0