LDAP AD type query

G

Guest

Greetings,
Is there a simple way to get this to work from an ASP.NET 2.0 vb.net page?
I just want the firstname and surname values for a userid and this script
works quite well. I've researched for a while but can't quite find an example
that produces the same result in ASP.NET...
Note: I want to validate a userID exists in Active Directory before writing
it to a database...this will ultimately be done by a visually-impaired
individual and we want to elminate potential typos by matching the text input
against valid userid's in active directory (and maybe give a JAWS reader
prompt confirming the last and first names for that user id...)

I tried several variations of IwshRunTime .dll and the like but can not
quite duplicate the simple functionality of the below snippet...
all help appreciated!

Set WshNetwork = WScript.CreateObject("WScript.Network")
Set objSysInfo = CreateObject("ADSystemInfo")
strUser = objSysInfo.UserName <-- will use textbox value here ie -
txtUser.Text
Set objUser = GetObject("LDAP://" & strUser)
lastName = objUser.SN
msgbox lastName
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top