Jump to content
Sign in to follow this  
ACalcutt

PrepSys

Recommended Posts

My problem is automating this whole thing. I have 350 systems I need to clone over the next month and currently my methods are not very productive. Right now I can only do about 5 a night because I have to come in early in the morning and manually go to each of the ghosted systems and change the name to the "D"+ServiceTag (which is written on a label on the front of the computer as well), reboot, join the domain, reboot and move to the next.

What I need to do is take advantage of Ghost's abilities to run a local or remote application after the cloning process that will do the same thing automatically without human intervention.

If the best I can do is a program that pops up windows that need to be clicked on throughout the process, then I have no use for it as it won't save me any time.

I had assumed that since your prepsys app did most of these things already, that it would be a simple enough procedure to create one that I could just hard code into it the necessary credentials and so on and let it just do it's thing but I guess it's not as easy as that. Like it ever is right?

I really appreciate all your help anyway though but I guess I'm just destined to do this the hard way. I should just be glad that I have ghost and a Sonix and don't have to install everything by hand.

Share this post


Link to post
Share on other sites

Actually, maybe I gave up too soon!

I just commented out the line you suggested and ran it and sure enough, it changed the name as I need it and rebooted, ran the script again...

and then gave another error. But hey, it's almost there! I noticed on the next part (joining AD) it looks like it makes a bunch of message boxes. I don't mind if it just pops up and gives the status, but I really need this to be automatic and not require any user input at all and just do it's thing.

Anyway, here is the current error:

Share this post


Link to post
Share on other sites

It looks like one (or both) of these two variable on line 36 isn't being set anywhere.

$strComputer

$strComputerDomain

should they be set somewhere or just renamed to one of the variables we declared at the top?

We're half way there! It already changed the computer name, rebooted, and then ran itself again! SOOO sweet.

Share this post


Link to post
Share on other sites

It looks like one (or both) of these two variable on line 36 isn't being set anywhere.

$strComputer

$strComputerDomain

should they be set somewhere or just renamed to one of the variables we declared at the top?

We're half way there! It already changed the computer name, rebooted, and then ran itself again! SOOO sweet.

Share this post


Link to post
Share on other sites

sorry for the double post. too much caffiene, clicked the "add reply" button twice.

Anyway, moved past that issue and now I'm to another error. Please see the bmp I uploaded. Think this one is on line 53.

error05.bmp

Share this post


Link to post
Share on other sites

sorry for the double post. too much caffiene, clicked the "add reply" button twice.

Anyway, moved past that issue and now I'm to another error. Please see the bmp I uploaded. Think this one is on line 53.

that looks like the other line i said to comment out. Comment out
GUICtrlSetData($current_action, "Joining to Domain")

As for your question about the gui. I made it so it requires no intervention unless there is a problem joining the domain. if there is a error it allows you to change the information in the gui and then try again

Edited by ACalcutt

Share this post


Link to post
Share on other sites

What a Masterpiece! I'll be trying it on the next machine that falls into my grips! May help me with the occasional one-off machines that we buy for teachers. Not to mention making the master image for the dozens of like-machines that come in every summer... Thank you!!


...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format

Share this post


Link to post
Share on other sites

What a Masterpiece! I'll be trying it on the next machine that falls into my grips! May help me with the occasional one-off machines that we buy for teachers. Not to mention making the master image for the dozens of like-machines that come in every summer... Thank you!!

Thats what I use the program for. I have to keep our labs and faculty computer images up to date. save me a lot of time.

If you have any problems try v0.93 instead....the current version(v0.94) is very untested.. but v0.93 has been used a lot

Share this post


Link to post
Share on other sites

Prepsys Udated 3/1/07

-Added some features i accidently took out when i modified the GUI (revision mixup). These changes where never publicly released

The main feature is my configuration loader when you browse for a auto install program

Posted Image

Share this post


Link to post
Share on other sites

Okay, after stripping out all the gui stuff, correcting a few more issues, and fine tunning it a little I've managed to get it to do what we need it to.

The only weekness that I can see is that if you try to run it on a system that has EVER been on a domain before, you get errors and it fails. Must be some residual settings in either WMI or the registry. For example, if I take a system and remove it from the domain (the typical way through system properties) and reboot as it asks, then go to AD and remove the computer account, then try and run the app it spits out a bunch of errors. However, if I take the same machine and remove it from the domain, delete the computer account out of AD, format the drive, reload windows, then run the app it works.

So this is the way I have it set up:

I set up a system the way we need it with all the drivers for the different model Dell systems we have, all the software we use etc. Then I copy the app to a hidden directory, setup sysprep to do a completely automatic setup with no interaction what-so-ever and detecting all hardware (both plu-n-pray and none) and then tell sysprep to login as local admin 2 times and run this app at first login. Then I run sysprep and when it shuts down I create a ghost image of it and either put it on a DVD with the ghost boot/auto-clone settings or put the image on our ghost cast server. Then when I need to setup a new system or re-image an old one, I simply clone it using this image and walk away!

It works great. It clones the system, changes the name to D+servicetag, reboots, joins the domain in the correct OU, reboots and when the user comes in the next morning it sitting at the login just waiting for them and I didn't have to do a thing!

Share this post


Link to post
Share on other sites

Okay, after stripping out all the gui stuff, correcting a few more issues, and fine tunning it a little I've managed to get it to do what we need it to.

The only weekness that I can see is that if you try to run it on a system that has EVER been on a domain before, you get errors and it fails. Must be some residual settings in either WMI or the registry. For example, if I take a system and remove it from the domain (the typical way through system properties) and reboot as it asks, then go to AD and remove the computer account, then try and run the app it spits out a bunch of errors. However, if I take the same machine and remove it from the domain, delete the computer account out of AD, format the drive, reload windows, then run the app it works.

How do you mean it fails. Is it giving a a error in the join domain box(or $strHelpMsg since you took out the gui) ? It sound to me you have a permissions issue. For Example, My Account is able to overwrite computers in Active Directory, But our lower techs can only join computers, they cant overwrite old computers in AD(so the computer needs to be deleted out of AD first). I have never had any issue joining a computer a second time with my script, but if there is one i would like to know about it so i can fix it.

Just another thought. If your computer hasn't been taken off the domain and put into a workgroup before trying to rejoin the domain I think the domain join will fail

Edited by ACalcutt

Share this post


Link to post
Share on other sites

Not a permissions issue.

If I take a computer that has a fresh (just meaning never been on a domain) install of windows and whatever apps I want, run this little program of ours it does exactly what we want it to do. Renames it, reboots, joins AD in the correct OU, reboots and waits for a login.

If that point I go to system properties, move it from the domain and to a workgroup, reboot. Go into AD users and computers and remove the (now disabled) computer account and then try to run our app again, it gives some generic error about something not being an object. (Sorry so vague, I'll snap a screen shot of the error tomorrow and post it for you).

Now if I take that same computer and put in another drive with a clean system on it (same thing, I just mean that it's never been on a domain before) and run the app it works fine.

So it's not an AD thing, it's not a permissions issue, it's not really the app per/say. It would seem to me that something in the app looks at something on the PC using WMI or registry, and is choking because if that system was ever joined to the domain, it leaves a trail somewhere that is confusing the app. Even though all the proper steps have been taken to remove the computer from the domain both locally and in AD, it still has some trace of information somewhere that the app looks at that says it was (or is) on the domain.

As a side note. How hard would it be to add something that would change the first login to choose the domain as the place to login rather than the local system? Let me clerify. When windows boots up and you hit Ctl+Alt+del to login, there are three text boxes, Username, password, and login to, the default location to log into is the last place it logged into before. And since the last place these systems logged in was locally, they have the computer name selected in the "Log into:" text box. My users aren't bright enough to drop down the list and choose the domain name and will sit there for an hour trying to log into the local machine with their network login despite my instructions letting them know that after we re-image their computer they need to change that the first time they log in.

So what I need is something that after it joins the domain, but before it reboots, it goes into the registry and tells it that the "Log into:" box should have the domain selected not the local computer.

That way I can just ghost their computer with our image that has this little app of ours set to run and not have to worry about getting a phone call from the user saying that they can't log in.

Share this post


Link to post
Share on other sites

As a side note. How hard would it be to add something that would change the first login to choose the domain as the place to login rather than the local system? Let me clerify. When windows boots up and you hit Ctl+Alt+del to login, there are three text boxes, Username, password, and login to, the default location to log into is the last place it logged into before. And since the last place these systems logged in was locally, they have the computer name selected in the "Log into:" text box. My users aren't bright enough to drop down the list and choose the domain name and will sit there for an hour trying to log into the local machine with their network login despite my instructions letting them know that after we re-image their computer they need to change that the first time they log in.

So what I need is something that after it joins the domain, but before it reboots, it goes into the registry and tells it that the "Log into:" box should have the domain selected not the local computer.

That way I can just ghost their computer with our image that has this little app of ours set to run and not have to worry about getting a phone call from the user saying that they can't log in.

that should be easy...just have it run this at the end ofr the script

$domain = "DOMAIN" ;domain you want the user to log into
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultDomainName", "REG_SZ", $domain)

I still find your domain join problem wierd.. i've had computers that I gave the wrong namewith my script(prepsys), then used my script to rejoin them

Edited by ACalcutt

Share this post


Link to post
Share on other sites

Cool Script, one observation only, you may want to remove the Worcester State College XP product key from the sysprep.inf file

Share this post


Link to post
Share on other sites

Cool Script, one observation only, you may want to remove the Worcester State College XP product key from the sysprep.inf file

thanks for the tip. I have fixed that on all my revisions of prepsys

Edited by ACalcutt

Share this post


Link to post
Share on other sites

Download Updated 6/17/07 v0.955

*Updated 6/17/07

-fixed problem where network credentials werent saved, so after a reboot programs wouldn't load (cause they could not authenticate)

-added windows installer into run menu

-started using "HKEY CURRENT USER" instead of searching for the registry location "HKEY_USERS\S-1-5-21......" ... its the same thing so theres no need to search for it

-modified change computer name script so the NetBIOS name is limited to 15 characters (if its more than 25 it causes windows to not boot)

-various bug fixes

Share this post


Link to post
Share on other sites

If anyone has found any bugs or has any suggestions, please let me know. I would like to make the run list more configurable but I am not sure how to do it, so i am also looking for suggestions on that. maybe using an ini to populate the run section and programs tab.

Thanks

Andrew

Edited by ACalcutt

Share this post


Link to post
Share on other sites

Hi,

yesterday I have played a little bit with the program. One error I have found is that the "installed.bmp" is shown behind "Sophos" if McAfee Virusscanner is installed.

The I have tried to compile both programs with the current beta of AutoIt. Both programs are showing errormessages because the names of the GUICtrlListView have changed a little bit from _GUICtrlListView... to _GUICtrlListView_...

And AU3CHECK brings a lot of errormessages for undefined variables before using the variables.

I hope this helps!


Mit freundlichen GrüßenJens

Share this post


Link to post
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
Sign in to follow this  

×
×
  • Create New...