none
How to validate if user credentials are valid on the local (or given) domain? RRS feed

  • Question

  • Hello everyone,

    I'm looking for an example on how to check if my user's credentials are valid on the local machine (or on a given domain).

    Basically, i want to specify the username + password and check if it is valid.

    Does anybody know how i can do this?

    Thanks in advance,
    Luís Silva
    Tuesday, March 4, 2008 3:44 PM

Answers

  • There are several ways of doing this, but perhaps the easiest is by using the LogonUser or LogonUserEx api function. Try looking up those functions on http://pinvoke.net for samples. If you specify "." for the domain parameter, it will look to the local user database rather than the domain directory.

    Tuesday, March 4, 2008 7:43 PM

All replies

  • There are several ways of doing this, but perhaps the easiest is by using the LogonUser or LogonUserEx api function. Try looking up those functions on http://pinvoke.net for samples. If you specify "." for the domain parameter, it will look to the local user database rather than the domain directory.

    Tuesday, March 4, 2008 7:43 PM
  • Thank you very much!

    I'll have a look at it Surprise)

    Best,
    Luís
    Tuesday, March 4, 2008 9:30 PM