RosettaCodeData/Task/Active-Directory-Search-for-a-user/VBScript/active-directory-search-for-a-user-1.vb
2013-04-11 11:14:19 -07:00

7 lines
295 B
VB.net

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