Home All Groups Group Topic Archive Search About
Author
8 Apr 2005 2:53 PM
Greg
I am trying to figure out how to validate a userid against AD.  At the time
the user will be logged on as the local admin, right after puuling down a
fresh image.  the form asks for the userid and password to attach to a
network share to install extra software on the machine.  If the user types it
wrong, it will just hang there.  i am using shell("net use \\srvname\share
/user:domain\Userid password", appwinstyle.hide, true).  Is there a way to
check to make sure it is valid before running the above command?

Author
8 Apr 2005 3:01 PM
Cor Ligthert
Author
8 Apr 2005 6:51 PM
Greg
That gave me something to look at but it will take time to understand.  I am
still green at this so i really don't know what i am doing. 

Show quoteHide quote
"Cor Ligthert" wrote:

> Greg,
>
> Do you know this class?
>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemSecurityPrincipalWindowsPrincipalClassTopic.asp
>
> Maybe something for your problem
>
> Cor
>
>
>
Author
9 Apr 2005 8:22 AM
Adam Goossens
Did you try to find out why it's hanging with invalid data? If you can
solve that problem, you can leave the authentication up to Windows.

In regards to validating the username and password, since Active
Directory is LDAP-based it means you could use LDAP queries to try and
check the username and password data. I haven't got a clue about LDAP
queries (I've never had a need to learn), so I can't really help in that
area :)

If you want to use the LDAP route, check out the classes in the
System.DirectoryServices namespace.

Regards,
-Adam.

Greg wrote:
Show quoteHide quote
> I am trying to figure out how to validate a userid against AD.  At the time
> the user will be logged on as the local admin, right after puuling down a
> fresh image.  the form asks for the userid and password to attach to a
> network share to install extra software on the machine.  If the user types it
> wrong, it will just hang there.  i am using shell("net use \\srvname\share
> /user:domain\Userid password", appwinstyle.hide, true).  Is there a way to
> check to make sure it is valid before running the above command?