Jump to content

Multi reboot and RunOnceEx


wigadore

Recommended Posts

I have my RIS Image working well, but I have one step I just cannot seem to automate.

After the OS Image is pushed to the new PC I run a RunOnceEx that renames my Dell PC to it's service tag and installs a few apps and then reboots. What I need it to do after the reboot is auto login and run a second RunOnceEx Script that will jpin the PC to the domain as the new PC Name. The issue I am coming across is I have to login as admin to run the second script...or if I get the machine to autologin it will not un the script. Anyone know how to autologin and run a second script?

Link to comment
Share on other sites


Yes, we do a similar thing here. We image our machines, a first script renames it (among other things), it reboots to kick the new name into play and a second script joins it to the domain.j

At end of the first script, we set the auto login to use a local admin account and then repopulate the Run key in the Registry so that the second script executes after the reboot.

Link to comment
Share on other sites

Thanks mmarable for letting me know that it is possible. Now could ou take it a step further and explain it to me how to acheive this. How do you automate the login and call up a secone script. When I add an extra login in my risndrd.sif using the AutoLogonCount under GuiUnattended the script I call up will not run. Perhaps I am calling the second script wrong...but it works if I login manually.

Link to comment
Share on other sites

No, you'll only use the SIF file to set up the first autologin and first script.

Towards the end of the first script you'll do 3 things.

First, modify the Registry keys to set up the second autologin.

See the section "Auto-Logon" here: MSFN' Unattended Windows: Adding Users

Second, set the Registry key for the second RunOnceEx

See here: MSFN's Unattended Windows: RunOnceEx

Third, reboot the box.

The box will reboot, putting the new computer name into play. The autologin will then log in and execute your second script to join the domain, etc. You can do this over and over again. In our case, the second script joins the domain and does other domain work, then sets things up for a third script. This way our GPOs are in play when we script the install of software and such in that third pass.

Link to comment
Share on other sites

Thanks mmarable for the pointers. I will give it a shot right now. I thought that the sif was only used for the inital boot, but I saw another guy that was booting many times with it and I thought that was the answer that I have been beating my head against the wall for two weeks now and getting nowhere. I will post what I find as soon as I have it tested.

Link to comment
Share on other sites

mmarable - I have taken your suggestion and have tried applying it a few different ways and I cannot get the machine to autologon as described at Add user and Autologon.

I have added this Useraccounts.cmd:

net user Admin RISdeploy /add
net localgroup Administrators Admin /add
net accounts /maxpwage:unlimited
REGEDIT /S autologon.reg
EXIT

With this Autologon.cmd file:

Windows Registry Editor Version 5.00 

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
"DefaultUserName"="Admin"
"DefaultPassword"="RISdeploy"
"AutoAdminLogon"="1"

And I have added the Usersaccount.cmd to the [COMMAND] area of my sif, which did not work, and I have tried calling it up from my RunOnceEx prior to reboot. I still am prompted for a password for Admin and the script runs but does not join the domain. What as I doing wrong?

P.S. RISdeploy is not my password I use I changed it for security purposes!

Link to comment
Share on other sites

I made one edit on my autologin.reg and the issue went away. I added:

"ForceAutoLogon"="1"

Many documents state that XP does not need this line...but it seems to have fixed my issues. Thoughts anyone?

Edited by wigadore
Link to comment
Share on other sites

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...