Ok, I figure it out.
Following what I started yesterday I made a small bat file called "UnlockRTS.bat" to do the trick.
@echo off
echo "Enter Username"
set /p UserName=
psexec.exe \\%1 net.exe user %UserName% /active:yes
Pause
Exit
Then I defined a task in Royal TS
Command : UnlockRTS.bat
Argument : $Host$
Working Directory : %systemroot%
The same way, I made another bat file to reset password :
@echo off
echo "Enter Username"
set /p UserName=
echo "Enter New Password 1st time"
set /p Password1=
echo "Enter New Password 2nd time"
set /p Password2=
if %Password1%==%Password2% goto CHG
if not %Password1%==%Password2% goto ERR
:CHG
psexec.exe \\%1 net.exe user %UserName% %Password1%
Pause
Exit
:ERR
echo "Password1 is not the same as Password2. Please restart"
Pause
Exit
Remark :
- These BAT files requires psexec.exe (the link to download it can be found somewhere else on this forum).
- In my case, these BAT files are saved in folder C:\WINDOWS\system32