Index: wp-admin/includes/ajax-actions.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- wp-admin/includes/ajax-actions.php	(revision 33054)
+++ wp-admin/includes/ajax-actions.php	(revision )
@@ -326,6 +326,18 @@
 	wp_die( 1 );
 }
 
+/**
+ * Ajax handler for profile password
+ *
+ * @since 4.3
+ */
+function wp_ajax_new_password() {
+    $return = array(
+        'newpassword' => wp_generate_password( 24 )
+    );
+    wp_send_json( $return );
+}
+
 //
 // Ajax helpers.
 //
Index: wp-admin/admin-ajax.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- wp-admin/admin-ajax.php	(revision 33054)
+++ wp-admin/admin-ajax.php	(revision )
@@ -45,7 +45,7 @@
 
 $core_actions_get = array(
 	'fetch-list', 'ajax-tag-search', 'wp-compression-test', 'imgedit-preview', 'oembed-cache',
-	'autocomplete-user', 'dashboard-widgets', 'logged-in',
+	'autocomplete-user', 'dashboard-widgets', 'logged-in', 'new-password'
 );
 
 $core_actions_post = array(
Index: wp-admin/js/user-profile.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- wp-admin/js/user-profile.js	(revision 33054)
+++ wp-admin/js/user-profile.js	(revision )
@@ -13,18 +13,41 @@
 			pw_submitbtn_edit = $('#submit'),
 			pw_submitbtn_new = $( '#createusersub' ),
 			pw_checkbox = $('.pw-checkbox'),
-			pw_weak = $('.pw-weak')
+			pw_weak = $('.pw-weak'),
+            pw_firsttime = true
 		;
 
 		var generatePassword = window.generatePassword = function() {
 			if ( typeof zxcvbn !== 'function' ) {
 				setTimeout( generatePassword, 50 );
 			} else {
+
+                if( !pw_firsttime ) {
+
+                    $.ajax({
+                        url: ajaxurl,
+                        global: false,
+                        dataType: 'json',
+                        data: {'action': 'new-password'},
+                        success: function(response) {
+                            pw_field.val( response.newpassword );
+                            pw_field.trigger( 'propertychange' );
+                            pw_field.attr( 'type', 'text' ).focus();
+                            pw_field[0].setSelectionRange(100, 100);
+                        }
+                    });
+
+                } else {
+
-				pw_field.val( pw_field.data( 'pw' ) );
-				pw_field.trigger( 'propertychange' );
-				pw_field.attr( 'type', 'text' ).focus();
-				pw_field[0].setSelectionRange(100, 100);
+                    pw_field.val( pw_field.data( 'pw' ) );
+                    pw_field.trigger( 'propertychange' );
+                    pw_field.attr( 'type', 'text' ).focus();
+                    pw_field[0].setSelectionRange(100, 100);
+                    pw_firsttime = false;
+
-			}
+                }
+
+			}
 		};
 
 		pw_2.hide();
@@ -85,7 +108,6 @@
 		} );
 
 		pw_new.on( 'click', 'button.wp-generate-pw', function(){
-			pw_generatebtn.hide();
 			pw_line.show();
 			generatePassword();
 		});
Index: wp-admin/user-edit.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- wp-admin/user-edit.php	(revision 33054)
+++ wp-admin/user-edit.php	(revision )
@@ -462,7 +462,6 @@
 	<th><label for="pass1"><?php _e( 'New Password' ); ?></label></th>
 	<td>
 		<input class="hidden" value=" " /><!-- #24364 workaround -->
-		<button type="button" class="button button-secondary wp-generate-pw hide-if-no-js"><?php _e( 'Generate new password' ); ?></button>
 		<div class="wp-pwd hide-if-js">
 			<input type="password" name="pass1" id="pass1" class="regular-text" value="" autocomplete="off" data-pw="<?php echo esc_attr( wp_generate_password( 24 ) ); ?>" />
 			<button type="button" class="button button-secondary wp-hide-pw hide-if-no-js" data-toggle="0">
@@ -471,6 +470,7 @@
 			</button>
 			<div style="display:none" id="pass-strength-result"></div>
 		</div>
+        <button type="button" class="button button-secondary wp-generate-pw hide-if-no-js"><?php _e( 'Generate new password' ); ?></button>
 	</td>
 </tr>
 <tr class="user-pass2-wrap hide-if-js">
