Moved the Admin/Guest user check to the beginning of the script, where the new users are randomized. When rerunning the script on a system that's already hardened, the SetUserRight function fails because it uses new randomized accounts as input.
Modified the ValidatePasswords function and if statements to save passwords as a secure string.
Moved the Admin/Guest user check to the beginning of the script, where the new users are randomized. When rerunning the script on a system that's already hardened, the SetUserRight function fails because it uses new randomized accounts as input.
Modified the ValidatePasswords function and if statements to save passwords as a secure string.