Reset user password without using "Forgot password?"
It's easier these days:

$account = \Drupal::entityTypeManager()-&gt;getStorage('user')-&gt;load(1);
$account-&gt;setPassword('new password');
$account-&gt;save();