Automate password reset via catalog item

melsarrazin
Tera Contributor

I have a requirement to create a catalog item for missing devices. Ideally, we are wanting the manager to send in the catalog item, then the system will automatically reset the users password and email it to the manager. Then we are sending a task to security to remotely secure the device that is missing.

 

I am trying to set this up in Flow Designer. 

melsarrazin_0-1750877763706.png

 

I have the flow working as expected but am getting an error with the actual password reset. 

melsarrazin_1-1750877843674.png

I am unable to figure out how to change the password requirements or why ResetADUserPasswordAction.ps1 is failing. 

 

We are currently utilizing Service Desk and Self-Service Password Resets to reset users AD password. 

8 REPLIES 8

Thank you for your input. 

The catalog item is only to report a missing computer. We are trying to automate a password reset in Flow Designer. We currently have the Service Desk password reset function working and are trying to get it working through Flow Designer in the same way. We want the system to reset the password and send the manager a temporary password.

Ad requirements are only 7 characters and longer and it cannot be one of the previous 20 passwords. I cannot figure out where to find the password critera to change.

Okay @melsarrazin , so right now in the AD password reset action where you are taking the dynamic password value, where that is coming from? Because from what I see here from the attached ss is you have used the catalog variable only, so there I was trying to suggest you that we can add the regex so that we can restrict the user there itself, because I think this should Work fine without any errors but restricting on flow level will be tough and about the password criteria change I didn't understood what you want to do there, means you want to make any changes in that criteria in SNOW side or AD?

Hello @melsarrazin ,

 

Just wanted to check in to see if my earlier response helped you out or if you're still facing any issues. If your query is resolved, it would be great if you could mark my reply as helpful and accept it as the solution — that way it can also benefit others who come across the thread later.😊

 

Also, if you found any other responses helpful, feel free to mark those as helpful too. You can even accept multiple solutions if they contributed to resolving your issue.

 

Let me know if you need anything else!

 

Best regards,
Aniket Chavan
🏆 ServiceNow MVP 2025 | 🌟 ServiceNow Rising Star 2024

SD_Chandan
Kilo Sage

Hi @melsarrazin ,

Create a catalog item, trigger a flow on submission, and use a script or integration to reset the password and notify the user. 
script
var user = new GlideRecord('sys_user');
if (user.get('email', inputs.email)) {
var newPassword = generateRandomPassword(); // your custom function
user.setPassword(newPassword);
user.update();
gs.info("Password reset for: " + user.name);
}
Send an email to the user with the new password or reset instructions.

Kindly mark it correct and helpful if it is applicable.


Thank you
Chandan