Windows Server Hacks: Find Computers with Automatic Logon Enabled

O'Reilly |  Operating Systems, automatic logon, networking

You can see that we are simply parsing the serverlist.txt file for each server name, then instructing regfind to locate that Registry key. There are two caveats, though. First, the results can be hard to read while the search is going on. It is recommended that you pipe the results to a text file (the preceding example does this). Second, regfind is case-sensitive. This can make the search a bit longer, but it's still fairly easy. Instead of just a one-line batch file, you simply have a few more (almost identical) lines. A larger sample of the completed batch file looks something like this (again, all on one line -- beware of line wrap):



for /F %%A in (serverlist.txt) do (c:\work\adminlogon\regfind.exe -m \\%%A-p "hkey_local_machine\software\microsoft\windows nt\currentversion\winlogon" -n "Autoadminlogon" >results.txt)for /F %%A in (serverlist.txt) do (c:\work\adminlogon\regfind.exe -m \\%%A-p "hkey_local_machine\software\microsoft\windows nt\currentversion\winlogon" -n "AutoadminLogon" >results.txt)for /F %%A in (serverlist.txt) do (c:\work\adminlogon\regfind.exe -m \\%%A-p "hkey_local_machine\software\microsoft\windows nt\currentversion\winlogon" -n "AutoAdminlogon" >results.txt)for /F %%A in (serverlist.txt) do (c:\work\adminlogon\regfind.exe -m \\%%A-p "hkey_local_machine\software\microsoft\windows nt\currentversion\winlogon" -n "AutoAdminLogon" >results.txt)for /F %%A in (serverlist.txt) do (c:\work\adminlogon\regfind.exe -m \\%%A-p "hkey_local_machine\software\microsoft\windows nt\currentversion\winlogon" -n "autoAdminlogon" >results.txt)for /F %%A in (serverlist.txt) do (c:\work\adminlogon\regfind.exe -m \\%%A-p "hkey_local_machine\software\microsoft\windows nt\currentversion\winlogon" -n "autoadminlogon" >results.txt)for /F %%A in (serverlist.txt) do (c:\work\adminlogon\regfind.exe -m \\%%A-p "hkey_local_machine\software\microsoft\windows nt\currentversion\winlogon" -n "autoAdminLogon" >results.txt)for /F %%A in (serverlist.txt) do (c:\work\adminlogon\regfind.exe -m \\%%A-p "hkey_local_machine\software\microsoft\windows nt\currentversion\winlogon" -n "autoadminLogon" >results.txt)

Using this method, you can scan a select list of workstations/servers for this key fairly quickly.

Hacking the Hack This procedure can easily be modified to find out other Registry keys as well, simply by changing the key name to search for. Enjoy!

—Donnie Taylor

Join us:
Facebook

Twitter

Pinterest

Tumblr

LinkedIn

Google+

Operating SystemsWhite Papers & Webcasts

See more White Papers | Webcasts

Answers - Powered by ITworld

Ask a Question