cross checking AD user and pass

Recommended Posts

Zlow 0

Zlow 0

I've spent almost 2 hours searching now but haven't found anything remotely useful. I'm trying to authenticate the user/pass provided by a user. The problem I'm having is not getting errors when using the RunAs function.

This portion of the script works perfectly unless an invalid username, domain, and/or password are passed to the function. If that is the case, explorer is indeed closed but then ran under the currently logged in user credentials. I need to verify the username and password are correct before passing them to this function.

--background--

For anyone curious, I'm doing this because we frequently have to change program settings or control panel options at the users desktop. Previous to IE7 we could simply right click IE, choose run as, authenticate with our domain admin credentials, use the IE address bar to navigate as needed. However starting with IE7, this does not work. I have to promote the user to admin, log out, log in, make the changes, remove admin rights, and log out/in again. I've found that I can kill explorer and run it with my credentials to get the access I need, make my changes, then kill explorer and run it as the user again. I'm writing this script to do just that, faster.