Check if user password input is valid in Powershell script

Posted by Doltknuckle on Server Fault See other posts from Server Fault or by Doltknuckle
Published on 2011-06-01T22:29:56Z Indexed on 2012/10/10 3:40 UTC
Read the original article Hit count: 459

Filed under:
|
|

I am working with a Powershell script that adds scheduled tasks to systems in our domain. When I run this script, it will prompt me for my password. I sometimes fat finger the password and the process starts, which locks out my account. Is there a way to verify my credentials to make sure that what I typed in will validate with the Domain?

I'd like to find a way to query the Domain controller. I've done some Google searches and I should be able to do a WMI query and trap for an error. I would like to avoid that style of validation if possible.

Any ideas? Thanks in advance.

© Server Fault or respective owner

Related posts about domain

Related posts about powershell