One of the first admin tasks that I used PowerShell to simplify was the unlocking of Dynamics GP user accounts. If you’ve dealt with this before, you know what a PITA it is to simply unlock someone’s GP account if they entered the wrong password too many times. This is a simple attempt at avoiding the headache of having to…
- Login to SQL Management Studio
- Reset the password for the user’s SQL login.
- Unlock the user’s SQL login.
- Launch Dynamics GP, login, and reset their password (again) within GP.
Instead, you can use this script and do the following…
- Launch this script.
- Choose the user in the drop-down, and click a button.
- Go back and work on something else 🙂
It could use some improvements, but it’s a “version 1” attempt at making our lives easier, and it has already come in handy many times.
[Jan 21, 2016]
I just made some small adjustments, adding the option to also reset the user’s GP password if they have forgotten it. Some extra steps to get that working…
First, go into Dynamics GP and reset a test user’s GP password with your “new user temporary password” value, if you have one. If you don’t this won’t really work for you.
Go into SQL Server Management Studio, and run the following query for your test user that you just reset the password for…
SELECT name, password_hash FROM sys.sql_logins WHERE name = ‘YourTestUsersName’
Copy the value from the password_hash column, you’ll use that in the GP-UnlockUser.ps1 file, editing the value for the $global:gpPasswordHash global variable.
Check it out and let me know what you think 🙂