RosettaCodeData/Task/Active-Directory-Search-for-a-user/VBScript/active-directory-search-for-a-user-1.vb

8 lines
295 B
VB.net
Raw Permalink Normal View History

2013-04-10 22:43:41 -07:00
strUsername = "TestUser"
strQuery = "<LDAP://dc=skycityauckland,dc=sceg,dc=com>;"_
& "(&(objectclass=*)(samaccountname=" & strUsername & "));distinguishedname;subtree"
objCmd.ActiveConnection = objConn
objCmd.Properties("Page Size")=100
objCmd.CommandText = strQuery
Set objRS = objCmd.Execute