Verify a windows username?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an vb20005 app where the admin can add a user to the local User table.
I only want valid NT Users to be added to this table. At this point in time
I have the user typing it in becuase I didn't see any sort of active
directory dialog box.

In my dataGridView cell validating function I want to verify that the string
typed in is a valid user, is there somehting that can do this for me? I've
looked around the windowsidentity class and couldn't find anything... any
ideas?

FYI: I would love some sort of active directlry dialog box that is plug and
play that I don't know about which would erase the need for this verification.

thanks,
 
I have found the answer to this although I found a much easier one with
T-SQL. If you want to do this on the applicaiton side you use the
System.DirectoryServices namespace and create a directory searcher object.
This has more flexabiltiy than the TSQL way of doing it becuase you can
specigfy more information through the LDAP Path. Through T-SQL it is simply
'select @SID = SUSER_SID(@strUser)'. You get a null back if the user is not
valid.

Thanks,
Greg P.
 
Back
Top