Question Locked

Change logon password automatically

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I'm looking to do something odd. I want to be able to have an admin account and a regular user account on a laptop. The odd part is that I would like the admin password to change automatically based on the date for example. This way the user would not be able to "learn" the password once and continue using it.
Does anyone know of a way to do this? The issue is the laptop will not always be on-site to manually change the passwords.

3 replies

by patb071

How could somebody just learn the admin password? I imagine you would need to create a startup script but then if someone can view that script they can see how the password is setup to change.

If the Laptop is on the domain you can right-click my computer and select manage, right-click computer management select connect to another computer, browse to the computer you would like.

Then go to Local Users and Groups Users, right click admin and select set password

by bizzo

You might get into a bit of pickle with this. It will be possible to change the password via a script on your local admin account, with the password based on the date, eg:

----------------------------------------

@echo off&SETLOCAL

FOR /f "tokens=1-4 delims=/-. " %%G IN ('date /t') DO (call :s_fixdate %%G %%H %%I %%J)
goto :s_change_password

:s_fixdate
if "%1:~0,1%" GTR "9" shift
FOR /f "skip=1 tokens=2-4 delims=(-)" %%G IN ('echo.^|date') DO (
set %%G=%1&set %%H=%2&set %%I=%3)
goto :eof

:s_change_password
echo net user Administrator %mm%%dd%%yy%

ENDLOCAL

----------------------------------------

But the problem with this is when does it get run? You can't have it in the login script for the admin because you'd be changing the password after you've logged in. And you'd need to remember when the password was last set (last time you logged in as admin) to be able to work out the last password. You won't be able to run it as an ordinary user, as it's changing the admin password.

You might be able to set it up as a scheduled task, but if the machine is off when it's due to run then the password won't get changed. Unless there's a way of running a script like this when the machine boots up?

To keep the machine secure with regard to admin accounts and passwords, why not rename the administrator account to a random name and set the password, then rename the guest account to administrator and again, set a password. That way, if your user tries to crack the administrator's password, they're only going to get into a guest account!

This discussion is closed to new replies.