erezlevi Posted January 4, 2009 Posted January 4, 2009 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
Pain Posted January 6, 2009 Posted January 6, 2009 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
youknowwho4eva Posted January 6, 2009 Posted January 6, 2009 didn't someone make a vb to autoit converter in example scripts? Giggity
erezlevi Posted January 7, 2009 Author Posted January 7, 2009 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?
Zinthose Posted January 7, 2009 Posted January 7, 2009 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
erezlevi Posted January 7, 2009 Author Posted January 7, 2009 (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 January 7, 2009 by erezlevi
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now