auto local admin login by using .REG files

G

Guest

Hi, Im trying to configure a Norton Ghost task to push out a couple of .reg
files, apply them then reboot the pc. Upon rebooting, the pc will
automatically login using the local Administrator credentials. Which I
already have a .reg file that does set the DefaultUserName and
DefaultPassword to what I want, but here's my problem. Since every computer
name is different, I need a way to apply the correct domain(pc name) into the
Logon To: field. I have found that under:
HKCU\Software\Microsoft\Windows\ShellNoRoam=hostname...so what Im thinking if
maybe I could write a batch file to somehow pull the value of the ShellNoRoam
key and place it into HKLM\Software\Microsoft\Windows
NT\CurrentVersion\AutoLogon-AltDefaultDomainName key.

I have found that I could use "regedit /e File_Name.reg
HKCU/Soft/Micro/Win/blah_blah to export a certain registry key. But I
cannot for the life of me figure out how to apply what I've exported back
into the registry under a different key name.

Can anyone help me on this?

The ultimate goal is to be able to pull down a users data/files into a
Desktop DNA image, then push out a standard ghost image, then reapply the DNA
file..all totally automatic. This issue with auto login is my first hurdle.

Thanks to anyone that can shed some light!!!
 
T

Torgeir Bakken \(MVP\)

Ben said:
Hi, Im trying to configure a Norton Ghost task to push out a couple of .reg
files, apply them then reboot the pc. Upon rebooting, the pc will
automatically login using the local Administrator credentials. Which I
already have a .reg file that does set the DefaultUserName and
DefaultPassword to what I want, but here's my problem. Since every computer
name is different, I need a way to apply the correct domain(pc name) into the
Logon To: field. I have found that under:
HKCU\Software\Microsoft\Windows\ShellNoRoam=hostname...so what Im thinking if
maybe I could write a batch file to somehow pull the value of the ShellNoRoam
key and place it into HKLM\Software\Microsoft\Windows
NT\CurrentVersion\AutoLogon-AltDefaultDomainName key.

I have found that I could use "regedit /e File_Name.reg
HKCU/Soft/Micro/Win/blah_blah to export a certain registry key. But I
cannot for the life of me figure out how to apply what I've exported back
into the registry under a different key name.

Can anyone help me on this?
Hi

I suggest you use a VBscript (.vbs) for this:

'--------------------8<----------------------

Set oWshNet = CreateObject("WScript.Network")
Set oShell = CreateObject("WScript.Shell")

' get computer name
sComputerName = oWshNet.ComputerName

oShell.RegWrite "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" _
& "\Winlogon\AltDefaultDomainName", sComputerName

'--------------------8<----------------------

WSH 5.6 documentation (local help file) can be downloaded from here
if you haven't got it already:
http://msdn.microsoft.com/downloads/list/webdev.asp
 
G

Guest

Torgeir Bakken (MVP) said:
Hi

I suggest you use a VBscript (.vbs) for this:

'--------------------8<----------------------

Set oWshNet = CreateObject("WScript.Network")
Set oShell = CreateObject("WScript.Shell")

' get computer name
sComputerName = oWshNet.ComputerName

oShell.RegWrite "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" _
& "\Winlogon\AltDefaultDomainName", sComputerName

'--------------------8<----------------------

WSH 5.6 documentation (local help file) can be downloaded from here
if you haven't got it already:
http://msdn.microsoft.com/downloads/list/webdev.asp


--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx

Thanks Torgier, But I must ask..where does this VBS put the value for
ComputerName? Is it imported straight into the registry?
 
T

Torgeir Bakken \(MVP\)

Ben said:
Thanks Torgier, But I must ask..where does this VBS put the value for
ComputerName? Is it imported straight into the registry?
Hi

The VBScript above writes the computer name (contained in the variable
sComputerName) to the registry value AltDefaultDomainName under the key
HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\
 
G

Guest

Torgeir Bakken (MVP) said:
Hi

The VBScript above writes the computer name (contained in the variable
sComputerName) to the registry value AltDefaultDomainName under the key
HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\


--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx

Ok Let me ask you this: Your answers and VB have helped me bypass this
problem, but now I have another smaller issue directly related to this one.
I have compiled into exe, and AutoIt script that only watches for one window,
then once it appears it emulates hitting the "ENTER" key to accept the
window. Now Im wonderig where I could place a reference to this exe to where
it will be ran before anyhting else! The window is part of a group policy
that is enforced through out the entire organization. It is a logon banner
with an OK button. Immediately after hitting Alt+Ctrl+Del to be prompted for
your user/pass, this banner pops up, you must hit OK in order to be promted
for username and password. I want this exe to runbefore then so it can be
"watching" for that logon banner and subsequently emulate the ENTER keystroke
so my local Admin logon will be 100% automatic.

Can you help me with this?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top