How do I ensure that machine(s) in my "WORKGROUP" environment are auto-logging themselves in upon reboot.

Good morning Experts,

I have been using scripting for years to complete various task on both domain and workgroup computers. Currently , I am working with a small workgroup environment (Peer-To-Peer). I simply have my computers auto-logon when they reboot. This is only a test environment, so I am not concerned about the security risk involved here. I just test, test , test.

The scripts below are very simply code snippets that sets auto-logging into a given computer(s) with its appropriate User-name and Password, and then Reboots the machine:


Const HKEY_LOCAL_MACHINE = &H80000002
Computers = Array("GALACTUS","DRDOOM","UOP","REDSKULL","VMWARE")
Computers = Array("GALACTUS")
Set objSWbemLocator = CreateObject _
("WbemScripting.SWbemLocator")
'   On Error Resume Next
For Each Computer In Computers
WScript.Echo "Autologging " & Computer

Set oReg = objSWbemLocator.ConnectServer _
(Computer, "root\default:StdRegProv","ADMINISTRATOR", "THANnos08")
Set StdRegProv = oReg.Get("StdRegProv")
strKeyPath = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\"

strEntryName = "AutoAdminLogon"
strValue = "1"
StdRegProv.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strEntryName,strValue

strEntryName = "DefaultUserName"
strValue = "THANOS"
StdRegProv.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strEntryName,strValue

strEntryName = "DefaultPassword"
strValue = "THANnos8"
StdRegProv.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strEntryName,strValue

Next 

Open in new window



Const SHUTDOWN = 6 
wbemImpersonationLevelImpersonate = 3
wbemAuthenticationLevelPktPrivacy = 6
	Computers = Array("GALACTUS","DRDOOM","UOP","REDSKULL","VMWARE")
	Computers = Array("GALACTUS")
'   On Error Resume Next 
For Each Computer In Computers
	Set objLocator = CreateObject("WbemScripting.SWbemLocator")
	Set objService = objLocator.ConnectServer _
	(Computer, "root\cimv2", "ADMINISTRATOR", "THANnos08")
	objService.Security_.ImpersonationLevel = wbemImpersonationLevelImpersonate
	objservice.Security_.AuthenticationLevel = wbemAuthenticationLevelPktPrivacy
	Set colOperatingSystems = objService.ExecQuery _
	("SELECT * FROM Win32_OperatingSystem")
	For Each objOperatingSystem In colOperatingSystems
		ObjOperatingSystem.Win32Shutdown(SHUTDOWN)
	Next
Next

Open in new window


This code has worked 100%.
I looked at the registry settings for the remote machine and the settings were correct:

!
The reboot script reboots the machine ( works perfectly), but when the machine tries to auto-logon, I get this error:

!
I have tested these scripts on hundreds of windows 8.1 lab machines and they just work. why now, all of a sudden , even though both script run successfully, the machine doesn't auto-logon? It's probably something silly, so the more eyes I have on the code , may yield a solution.


And yes, I logged directly into the local machine to ensure that it has the correct password.

your help is appreciated.
GalactusAutologon1.PNG
BLACK THANOSAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

McKnifeCommented:
Don't know, but I would use the freeware autologon.exe from Microsoft and the script will become a one-liner and just work.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
BLACK THANOSAuthor Commented:
Input appreciated Mcnife
0
BLACK THANOSAuthor Commented:
McKnife , no Mcnife. Sorry
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

BLACK THANOSAuthor Commented:
The Microsoft community answered my question.

http://answers.microsoft.com/en-us/windows/forum/windows_8-security/reset-security-policies/7a0a0247-393f-4ed5-9066-2723d321a6d5

Specifics:

!
now autologon works like a charm.
0
BLACK THANOSAuthor Commented:
or alternatively:

this fixes the issue also.

!
0
BLACK THANOSAuthor Commented:
both of these options work McKnife. I will test the utility you gave me. If it works the points are yours even-though I found two alternative solutions that I have already scripted and work perfectly. I reward points for alternative ways of doing things. All information if valuable . Is this okay with you to give you the points once I test it for myself?
0
BLACK THANOSAuthor Commented:
I promise to do a bit more research before I come to the EE forum , to avoid these kinds of complications. My rule of thumb is if I can find it in a couple of hours, I go to EE. On this occasion, I simply went EE, breaking my own rule. Sorry.
0
BLACK THANOSAuthor Commented:
McNife wrote:

Don't know, but I would use the freeware autologon.exe from Microsoft and the script will become a one-liner and just work.

nope , didn't work Mcknife. Yields the same results as my script. I was a bit disappointed because if it worked, I like the axiom of KISS ( Keep it simple stu###) .  I would have used it.
0
BLACK THANOSAuthor Commented:
I  put the command line args into another machine and it works, with the caveat that it had to work with with elevated privileges. I used Psexec.

thx.
AutoLogon.PNG
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VB Script

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.