Jump to content

Simoneverett

Members
  • Posts

    12
  • Joined

  • Last visited

Blog Entries posted by Simoneverett

  1. Simoneverett
    Why
     
    At present the school i work haven't spent a penny in equipment/software since 2008/9, my predecessor had been using a unlicensed version of ghost, witch means either buy ghost or reinstall everything by hand.
     
    Believe it or not ghost was to expensive, installing everything by hand was the only way, for some time until i fell over the below YouTube clips;
     
    Introduction to Windows PE v2 0 Part 1 by AppDeploy - YouTube
     
    AppDeploy are amazing, after loads of googleing it soon became apparent use useful Windows PE was in conduction with ImageX and disk part,
     
    15 cds later and i had my self a networked workstation that installed its self, adding sysprep into the mix to get the imaged system onto the domain,
     
    Almost all the hard work was done ( i was wrong ), after looking over all the existing work I've done i soon released that i could have a massive mess on my hands so i looked at all the different options;
     
    Windows PE can boot from USB, CD, PXE Boot and Hard disk Partition (How do i boot it???)
    Image management ImageX or Xcopy??
    Settings?? XML? text documents? logging? php mysql webpage?
    How do i control it? how do the correct PC receive the correct images? EG the Dell 520 know to pull the relevant images down?
     
    After countless nights looking at all the options it became apparent, the computers already know what their called and what make and model they are. Windows WIMS has all the data i need, its a simple as running a wim query and writing the resulting data to the hard disk
     
    C:\hostname.txt = Computers name
    C:\make.txt = Manufacturer
    C:\model.txt = Model, did require some adjustments because i only wanted the 745 bit.
     
    Because Windows PE has access to the C: on first boot it was able to load theirs settings into RAM as system virables;
     

    IF EXIST c:\hostname.txt for /F "delims=" %%i in (c:\hostname.txt) do set Computername=%%i IF EXIST d:\hostname.txt for /F "delims=" %%i in (d:\hostname.txt) do set Computername=%%i IF %Computername% == null set /P Computername=Computer name: %=% echo ================== echo Computername: [%Computername%] echo ================== Y:\fart.exe %Settings_Drive%:\Computermake.txt " " --remove Y:\fart.exe %Settings_Drive%:\Computermake.txt " " --remove Y:\fart.exe %Settings_Drive%:\Computermake.txt "/n" --remove -c set Computermake=null IF EXIST c:\Computermake.txt for /F "delims=" %%j in (c:\Computermake.txt) do set Computermake=%%j IF EXIST d:\Computermake.txt for /F "delims=" %%j in (d:\Computermake.txt) do set Computermake=%%j IF %Computermake% == null SET /P Computermake=Enter Computer make: %=% echo ================== echo Computer make: [%Computermake%] echo ================== Y:\fart.exe %Settings_Drive%:\Computermodel.txt " " --remove Y:\fart.exe %Settings_Drive%:\Computermodel.txt " " --remove Y:\fart.exe %Settings_Drive%:\Computermodel.txt "/n" --remove -c set Computermodel=null IF EXIST c:\Computermodel.txt for /F "delims=" %%k in (c:\Computermodel.txt) do set Computermodel=%%k IF EXIST d:\Computermodel.txt for /F "delims=" %%k in (d:\Computermodel.txt) do set Computermodel=%%k IF %Computermodel% == null set /P Computermodel=Computer model: %=% echo ================== echo Computer model: [%Computermodel%] echo ==================
     
    Once windows PE knew what the computers name should be most of the blocks fell into place,
     
    Sysprep;
    Y:\fart.exe c:\sysprep\sysprep.inf change-me-computer-name %Computername%
     
    Copying the image from the server;
    ROBOCOPY g:\ d:\ Windows-XP-%Computermake%-%Computermodel%.wim
     
    ImageX
    "y:\Windows AIK\tools\x86\imagex.exe" /apply d:\Windows-XP-%Computermake%-%Computermodel%.wim 1 c:\
     
    Diskpart
    ECHO list disk > x:\CREATE.WIN.PE.TXT
    ECHO list vol >> x:\CREATE.WIN.PE.TXT
    ECHO select disk 0 >> x:\CREATE.WIN.PE.TXT
    ECHO select part 1 >> x:\CREATE.WIN.PE.TXT
    ECHO assign letter=k >> x:\CREATE.WIN.PE.TXT
    ECHO select part 2 >> x:\CREATE.WIN.PE.TXT
    ECHO assign letter=d >> x:\CREATE.WIN.PE.TXT
    ECHO select part 1 >> x:\CREATE.WIN.PE.TXT
    ECHO assign letter=c >> x:\CREATE.WIN.PE.TXT
    ECHO format label="WinXP" quick >> x:\CREATE.WIN.PE.TXT
     
    echo == Setting up the drives and formating ==
    diskpart /s x:\CREATE.WIN.PE.TXT
     
    After a few days of playing it started to look easy, but i had over looked something really important, whats the point of doing all this when i have to go to the PC to image it. say i update the image with some new software i then need to F12 200 PC.
     
    Thats like 15/20 cubs of coffee, forget that. i need a way to image the PC from my desk,
     
    Psexec.. perfect, i can run a batch file or something on the remote system while their in windows XP, but what uses it that??
     
    back to google, after a good look i relised i could use the windows 7 boot loader to boot Windows PE from a VHD. that wasted a day i dont know what i am doing wrong but i cant get VHD to boot using Windows 7's boot laoder.
     
    i uses the imaging process for about 1.5 months before i made the break through i needed, in fact it was a stupid webbook that gave me the idea, Toshiba ship some of their web books with a recovery partition, it looks alot like Windows 7 Boot screen.
     
    35Mins later and i had it in bits and soon relised i could using the existing Windows XP boot loader... I had already written the solution...
     
    Diskpart has a command called active, that sets the current part active for booting.
     

    ECHO list disk > x:\CREATE.WIN.PE.TXT ECHO select disk 0 >> x:\CREATE.WIN.PE.TXT ECHO clean >> x:\CREATE.WIN.PE.TXT ECHO create part primary size=50000 >> x:\CREATE.WIN.PE.TXT ECHO create part primary size=20000 >> x:\CREATE.WIN.PE.TXT ECHO select part 2 >> x:\CREATE.WIN.PE.TXT ECHO assign letter=w >> x:\CREATE.WIN.PE.TXT ECHO format label="WinPE" quick >> x:\CREATE.WIN.PE.TXT ECHO active >> x:\CREATE.WIN.PE.TXT ECHO list vol >> x:\CREATE.WIN.PE.TXT echo == Setting up the drives and formating == diskpart /s x:\CREATE.WIN.PE.TXT
     
    A clean 150 lines later and winpe.bat was able to take the flowing command line
     

    y:\winpe.bat image e12-
     
    30 cmd windows pop up, 20 seconds later all 30 PC in the it suite reboot and start imaging their self's, i shall include some links to you tube video over the new few days..
     
    If anybody knows of a easier way, please let me know.
     
    I am writing this blog to show others the madness in my ways, the current batch file is almost 400 lines, its almost self contented. its much easier to maintain one file with different scripts included that 10 over 3 different languages.
     
    Dissimilar: i am using a number of freely available programer to do something really useful, i didn't write them but did make the do something really useful.
  2. Simoneverett
    My ghost story.
     
    I've recenly taken over a large secondry schools it deparment, well when i say taken over my commanty won the contract and after a new months i got dumped with the problem of over 400 systems and 1 me,
     
    After looking at what we had. What end users were complaining about, mostly speed problems, turned out the NAS servers about had it, it turnes out we have Ghost installed on one of the 13 servers, but not the whole suite, with kinda sucks.
     
    so pushing out new images onto the many diffrent systems was always going to be a pain in the ass. and then haveing to name them by hand and add them to the AD and move then into the corect OU, and becuse we uses a System Var. to control the printers, i would need to set that as well. And becuse the existing images are like 13GB incluseing software IE office 2003.
     
    it was taking about 30 mins per system over 400+ system would take about over 200hr just to get eveything images, as a result most of the systems had a old broken image from 2006, that seemd to be devloping problems with some BROKEN MSI that a perviuse tech tryed to make him self.
     
    i started looking about for a work around, tryed talking to the people i worked with see if they could suggest away to speed things up, all i got back was stop beening a lazzy as, then were beening payed for you to do eveything by hand then were happy,
     
    dosent solve my problem. or even help for that matter,
     
    first off i looked at my problem, i needed away to install a copy of Windows XP Vol, then config it to auto rename its self and add its self onto my domain,
     
    as we all know evey pc has its own MAC address, so that seemed like a easy way to start from,
     
    so i check out to see if i could harvist my existing computer names, what a suppirse none of the curent PC names dont have anything to do with were they are. in the school.
     
    So i have to make note of the MAC, NEW HOSTNAME AND were ad AD i want them to go. as ive got to uses a Batch file i started with a text CSV layout. EG
     
    00-13-72-CB-1B-12,LIB-12,LIB,
    00-13-72-CB-1B-A3,LIB-06,LIB,
    00-13-72-CA-F4-22,LIB-05,LIB,
    00-13-72-CB-15-B7,LIB-04,LIB,
     
    thats all fair and well but how to i do the look up??
     
    FOR /F "tokens=1,2 delims=," %%G IN (%MAC_CONFING_FILE%) DO IF %%G == %MAC% SET NEW_HOSTNAME=%%H
    FOR /F "tokens=1,3 delims=," %%G IN (%MAC_CONFING_FILE%) DO IF %%G == %MAC% SET NEW_OU=%%H
     
    Useing a batch For can step thro text files one by one. Easy,
     
    perfect, how to i change the name of the system, well thats not so easy, NetDom can do this once your on the domain, and says it can do it when your off domain but not for me..
     
    so i used 3rd party problem from, i beleve it change a had full of reg entrys.
     
    http://www.willowhayes.co.uk/
     
    add to domain usesing NETDOM by MS,
     
    cool, now what happens if i need to add something to my script after the image has been taken, becuse the verson of ghost i have a about 3 million years old <8? i cant exit images that are NTFS, so i used a prelaoders that mount a network drive so i can make changes at any point.
     
    Simple, well, after 100+ lines of batch and colecting over a 400 Mac addresses, to be colected its taken abit more work than i wanted but saves my hrs, expectly when i have already indexed and have a problem with it, i can set it imagesing 15 mins later its renameing its self and adding its self to the domain, when its come round for the last time loges it self on and the GPUPDATES reboots pulls down office and other software, then its ready to be used again, now its a 10 min images job
     
    i managed to get 50 system images in 1 half day, i even had change to have a 1 hrs sit down and cup of coffee,
×
×
  • Create New...