dbustamante
IS-IT--Management
Hey Everyone,
I modified one of my old scripts that's pretty basic in what it does checks to see if a user account is locked out if it is it will unlock domain account or tell you it's active and changes passwords for users. But when i get to the change password section if i type in a password that does not meet the password requirements it ask's you again till you finally get it right now even when you put it in with all the requirements it ask's you to type the password never going to the step 4. Can someone tell me what I have to enter to make jump to the last step if it is successful and back to step 3 if it errors out.
Any help is greatly appreciated.
I modified one of my old scripts that's pretty basic in what it does checks to see if a user account is locked out if it is it will unlock domain account or tell you it's active and changes passwords for users. But when i get to the change password section if i type in a password that does not meet the password requirements it ask's you again till you finally get it right now even when you put it in with all the requirements it ask's you to type the password never going to the step 4. Can someone tell me what I have to enter to make jump to the last step if it is successful and back to step 3 if it errors out.
Code:
@echo off
:top
cd c:SET /P user=Please Insert A Username:
net user %user% /DOMAIN | FIND /I "account active"
:1
Net user %user% /domain /active:YES
goto :2
set /p userinp="Would you like to unlock the user?(Y/N)" %
IF "%userinp%"=="N" goto 2
IF "%userinp%"=="Y" goto 1
IF "%userinp%"=="n" goto 2
IF "%userinp%"=="y" goto 1
:2
set /p userinp="Would you like to change the user's password?(Y/N)" %
If "%userinp%"=="N" Goto exit
If "%userinp%"=="Y" Goto 3
If "%userinp%"=="n" Goto exit
If "%userinp%"=="y" Goto 3
:end
:3
SET /P Password=Type the new password:
net user %user% %password% /DOMAIN
GOTO end
:4
set /p userinp="Would you like to make any other profiles?(Y/N)" %
If "%userinp%"=="N" Goto exit
If "%userinp%"=="Y" Goto Top
If "%userinp%"=="n" Goto exit
If "%userinp%"=="y" Goto Top
Any help is greatly appreciated.