Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Bulk Password Reset

Venkat99
Tera Contributor

Hi Guys,

Any suggestions on how to perform Bulk password reset ??

Any scripts if possible ?

Tried a simple script but able to update all the other fields on the user form, but unable to update the Password.

1 ACCEPTED SOLUTION

Venkat99
Tera Contributor

Its working now.

 

here is the script,

 

resetPassword();
function resetPassword() {
var gr = new GlideRecord('sys_user');
gr.addActiveQuery();
gr.query();
var count = gr.getRowCount();
if (count > 0) {
while (gr.next()) {
gr.setDisplayValue("user_password","Password123456");
gr.update();
}
}
}

View solution in original post

2 REPLIES 2

GTSNOW
Giga Guru

Can you share the script. This should be done without any challenges.

Venkat99
Tera Contributor

Its working now.

 

here is the script,

 

resetPassword();
function resetPassword() {
var gr = new GlideRecord('sys_user');
gr.addActiveQuery();
gr.query();
var count = gr.getRowCount();
if (count > 0) {
while (gr.next()) {
gr.setDisplayValue("user_password","Password123456");
gr.update();
}
}
}