It is probably more accurate to state that this is code from different people put into a instantly usable script.
First, credits go to:
- For the encrypt\decrypt code: http://www.autoitscript.com/forum/topic/126973-encrypt-decrypt-data-in-a-ini-file/page__p__881156#entry881156
- For the Verification against AD code: http://www.autoitscript.com/forum/topic/40414-password-validation-against-active-directory/page__p__831640#entry831640
I have added commentary in the scripts that will hopefully help the newbie factor out a bit. I've been there and its nice to have helpful comments.
In case you need to compare your situation with mine:
- I work on a helpdesk. I log on with a standard signon and use a different signon for administrative tasks. I am using this to run other scripts as an administrator.
In "CredCheck.au3", it will check the username and password given against Active Directory. If it fails, it will let you know. If it succeeds, it will run the given program or script as administrator. It also writes the password to an ini file and encrypts it, and also writes the username - unencrypted.
In "Unencrypt Test.au3" it will unencrypt the password which will allow it to be injected into password fields of remote pc's if needed. In my case, I did need this.
CredCheck.au3 3.57K 215 downloads
unencrypt test.au3 1.75K 137 downloads
Good luck and any criticism welcome!