Get-Credential and Validate

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 5 years and 4 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
dank42
Posts: 61
Last visit: Tue Apr 26, 2022 7:49 am

Get-Credential and Validate

Post by dank42 »

Hi,

I have a GUI which requires the user to enter their AD Credentials for certain tasks to run.

I want to be able to validate the users credentials and return an error if the password is incorrect. What is the best method for this?

I am using Get-Credential
  1. $Cred = Get-Credential -UserName $env:USERNAME.ToLower() -Message "Authentication"
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Get-Credential and Validate

Post by jvierra »

The only way to validate credentials is to try and use them.
This topic is 5 years and 4 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked