Jump to content

Recommended Posts

Posted

Does anyone have or know of a script that would log a user onto a pc? This would then enable me to log in on lots of computers at the same time rather that going to each machine.

 

Thanks

Guest TheLibrarian
Posted



@echo off 
if "%1" == "" goto end
for /l %%i in (0,1,30) do (
start "Addreg %%i" reg add "\\%1-%%i\HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /f /v AutoAdminLogon /t REG_SZ /d 1
start "Addreg %%i" reg add "\\%1-%%i\HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /f /v DefaultUserName /t REG_SZ /d USERNAME
start "Addreg %%i" reg add "\\%1-%%i\HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /f /v DefaultDomainName /t REG_SZ /d DOMAINNAME
start "Addreg %%i" reg add "\\%1-%%i\HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /f /v DefaultPassword /t REG_SZ /d PASSWORD
start "Addreg %%i" reg add "\\%1-%%i\HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /f /v AutoLogonCount /t REG_DWORD /d 1
start "Restarting %1-%%i" shutdown -r -f -m %1-%%i -t 1
)

:end


rem %1 is the room name %i is the computer number   %1-%1 = machine name

 

 

Our PC naming structure may not work for you with this script, however I am sure you can modify it to suit.

 

If you set a logon message to appear after hitting the CTRL-ALT-DEL you will have to do a run round OK'ing that manually but that's it.

Posted

Our PC naming structure may not work for you with this script, however I am sure you can modify it to suit.

 

If you set a logon message to appear after hitting the CTRL-ALT-DEL you will have to do a run round OK'ing that manually but that's it.

 

Don't forget, you will need a script that reverses this process too, or scary things will happen!

Guest TheLibrarian
Posted

That's what the autologon count is for.

 

Upon reboot that is decremented and when it reaches 0 the credentials are removed.

 

However I do have a removal script too, just to be on the safe side.

 


@echo off
if "%1" == "" goto end
for /l %%i in (0,1,30) do (
echo ===============================================================================
echo %1-%%i Started
echo ===============================================================================
start "%1-%i Removing Autologon" /min reg delete "\\%1-%%i\HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /f /v AutoAdminLogon 
start "%1-%i Removing Autologon" /min reg delete "\\%1-%%i\HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /f /v DefaultUserName 
start "%1-%i Removing Autologon" /min reg delete "\\%1-%%i\HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /f /v DefaultPassword 
start "%1-%i Removing Autologon" /min reg add "\\%1-%%i\HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /f /v AutoLogonCount /t REG_DWORD /d 0
start "%1-%i Removing Autologon" /min reg add "\\%1-%%i\HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /f /v DefaultDomainName /t REG_SZ /d DOMAINNAME
start "Restarting %1-%%i" /min shutdown -r -f -m %1-%%i -t 1
echo ===============================================================================
echo %1-%%i Finished
echo ===============================================================================
)

:end


Guest TheLibrarian
Posted
Sorry, I missed that!

 

No problem, better to be safe than sorry.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...