Create a Password Reset Tool With a GUI

3Shares
Reading Time: 3 minutes

Create a Password Reset Tool With a GUI in Powershell

In a previous post “Create a windows password reset tool in Powershell” I created a simple password reset tool that worked inside the powershell terminal. Being excited with producing a successful product, I passed it on to my coworkers in multiple departments. Expecting nothing but praise in return, I received many complaints that the script was too difficult to run and understand.

My first thought was “how“? All they had to do was open the script and choose either y or n. Back to the drawing board. I thought how can I make this tool even easier? Thats when I decided to add a GUI to my original password reset tool script.

The Code

Download this powershell script on github.

 

How The Password Reset Tool With a GUI works

As soon as you open the script you’re given a few options. It asks for a username and then you have the option to run a search or clear your input.

password reset tool

Theres a try and catch statement, so if you enter a username that does not exist, the GUI will inform you. Just hit the clear button if you run into this issue.

powershell gui

Once a username is entered, the GUI will grab the account information from active directory and display the users Name, Account Enabled Status, Lock Out Status, Password Last Reset Status, and displays two new buttons for password resets and account unlocks.

powershell active directory

Both the Reset Password button and the Unlock Account button have try and catch blocks. So the password reset tool gui will inform you if it was successful or unsuccessful in unlocking an active directory account or resetting a users password.

active directory

This script should be able to run in Windows 7-10. Make sure to have the PowerShell Active Directory module installed as well. Also check out PoshGui. It’s my go-to site when I want to create a complex powershell GUI in literally minutes.

Feel free to leave a comment below with any suggestions or questions.


Interested In learning Powershell?

Check out “PowerShell in Depth“. PowerShell in Depth, Second Edition is the go-to reference for administrators working with Windows PowerShell. Every major technique, technology, and tactic is carefully explained and demonstrated, providing a hands-on guide to almost everything an admin would do in the shell. Written by three experienced authors and PowerShell MVPs, this is the PowerShell book you’ll keep next to your monitor—not on your bookshelf!

What’s Inside

  • Automating tasks
  • Packaging and deploying scripts
  • Introduction to Desired State Configuration
  • PowerShell security
  • Covers PowerShell version 3 and later

This post “Create a Password Reset Tool With a GUI in Powershell” is located under the Programming Category

Learn how to create a Build a dynamic menu written in Powershell!

3Shares

admin

Leave a Reply

Your email address will not be published.