Deployment Solution

 View Only
  • 1.  imaging to remote sites using winpe

    Posted Aug 30, 2011 04:09 PM

    I found an article( HOWTO6474 ) explaining how to distribute an image to remote sites by pulling the from a local site store (i'm assuming that the site store does not have to be a pxe server).

    However the article is not very descriptive. (pasted the article at the bottom)

    my server name = ns6

    I'm i correct in assuming that i do not need pxe servers on all local sites?

    (pic1) should my winpe path be \\ns6\express or should it be a variable like \\%SERVERNAME%\express?

    (pic2) i took the script and made getsrv.bat and added it to the startup folder.... should i add the "server.lst" in the startup folder aswell?

    (pic3) when i create the distribute image job should my path be "G:\image path" or some like \\"%SERVERNAME%\image path" ? 

     

    Article pasted below.....

     

    Question
    The DS Image Distribution Framework is a utility that allows large customers ensure that a single PXE configuration is available across the enterprise and different PXE Servers.

     

    It uses a mechanism that looks up the local file server IP address before setting a DOS environment variable that defines the local share to which the agent will connect a given drive (see article 31186).

     

    How can this feature be ported to the Windows automation environment?

    Answer
    The DS team has incorporated some hooks in the WinPE loading process to allow for OEMs or customers to load custom elements in the registry or WinPE run time environment.

    This hook will execute anything that is in the X:\startup folder, as long as the extension are registered with an executable type (so .reg, .bat, .vbs, or .cmd should all execute by default).

     

    This allows you to add VBS scripts to look up the current IP address and, based on the server.lst file, define the entry that should be used to map the local file server before the AClient is loaded.

     

    Here is a batch script that will retrieve the WinPE IPAddress, lookup the server.lst file and set the share (G:\) to the local PXE server.

    @echo off
    cls

    set Debug=0

    :GetIpAddress
     IPCONFIG |FIND "IP" > %temp%\TEMPIP.txt
     if not %errorlevel%==0 goto OUT
     FOR /F "tokens=2 delims=:" %%a in (%temp%\TEMPIP.txt) do set IpAddress=%%a
     del %temp%\TEMPIP.txt
     set IpAddress=%IpAddress:~1%
     if %Debug%==1 echo System IP address is:  %IpAddress%

    :GetSubnetAddress
     set i=0

    :Loop
     if %i% EQU 3 Goto OUT
     set /a i+=1
     for /f "tokens=%i% delims=." %%a in ("%IpAddress%") do set v=%%a
     if %i% == 1 (set s=%v%
      ) else set s=%s%.%v%
    Goto Loop

    :OUT
     set Subnet=%s%
     if %Debug%==1 echo Subnet address is:  %Subnet%

    :GetPXEServer
     type server.lst | find "%subnet%" > %temp%\TEMPPXE.txt
     for /f "tokens=2 delims=," %%a in (%temp%\TEMPPXE.txt) do set PXEServer=%%a
     del %temp%\TEMPPXE.txt
     if %Debug%==1 echo Local PXE Server is:  %PXEServer%


    :MapPXEServer
     if %Debug%==1 (echo net use G: "\\%PXEServer%\eXpress" /yes <nul
     ) else net use G: "\\%PXEServer%\eXpress" /yes <nul

    Note: The shared folder is set to eXpress, but this could be changed. The batch and server.lst should be in the same directory



  • 2.  RE: imaging to remote sites using winpe
    Best Answer

    Posted Aug 31, 2011 09:02 AM

    1. You are correct in assuming you don't need PXE servers at all local sites as long as the following considerations are taken:

     - iphelpers are setup to direct PXE/DHCP requests to the appropriate servers
     - You are prepared to distribute the WinPE image across your WAN (because of the size and amount of time it sometimes takes and how much bandwidth you have available, you may want to consider putting a PXE server physically at each location).

    2.  PIC1 question - This should be mapped to your DS express share.  You will want to map an additional drive for your image store.  Be careful not to use too low of a drive letter, especially when dealing with a machine that already has Windows 7 (i.e. from the PC manufacturer preloaded) and multiple drives.  I have come across a few instances where drive letters were used all the way to drive "I:".  Also, note you cannot use drive "X:".  The getsrv utility should map the appropriate drive for you in your script.  I am going to post my script below (mainly because I have several drive mappings for drivers, image deployment, image backup, etc.).  In the example below, I am using I: as my express mapping.  J: is my image deployment mapping.  K: is my image backup area.  L: is my driver area.  These are split due to the length of the path to get to these areas and Microsoft's memory limitations (number of characters).  This script will replace your winpe "mapdrv.bat".  I would suggest when you get to the file structure, you delete the existing "mapdrv.bat" and then put your own files in the additional files area.  The only other file you would modify would be the server.lst file, do not modify any other batch files.

     

    @net use i: "\\hqaltiris1\eXpress" /yes
    @call x:\tools\getsrv.bat /s "x:\tools\server.lst" /v SERVERNAME /m J: "express\altimages\baseimage" /d "DOMAINNAME" /u "USERNAME" /p "PASSWORD"
    @call x:\tools\getsrv.bat /s "x:\tools\server.lst" /v SERVERNAME /m K: "express\images" /d "DOMAINNAME" /u "USERNAME" /p "PASSWORD"
    @call x:\tools\getsrv.bat /s "x:\tools\server.lst" /v SERVERNAME /m L: "express\altimages\drivers" /d "DOMAINNAME" /u "USERNAME" /p "PASSWORD"
     
    3.  Pic2 question.  See above.  These files should be added under "additional files" as shown in my above attached image.
     
    4.  Pic3 question.  Your path for the distribute image should be whatever drive letter is used in the script above that maps to your "local" image store.
     
    Hope this helps.  Any questions or clarifications, please feel free to ask.


  • 3.  RE: imaging to remote sites using winpe

    Posted Aug 31, 2011 05:01 PM

    so much man, this put me on the correct path and it's working a treat now....

    i see you inserting drivers the winpe aswell, this is the next thing i have to tackle...

    currently my non lan drivers install is done in windows with a script below

    so this is not going to allow me to connect to the local remote store to install drivers...

    I would like to know how you are tackling this...

    echo off
    REM Install hardware drivers
    REM If model is unknown Windows 7 default drivers will be used
    REM and file NO_DRIVERS.txt will be created in C:\ 
    REM Windows 7 x86
    REM No network drivers
    echo Computer model:  %#!computer@model_num%
    set modelname=none

    rem -------------------HP Desktops-------------------------
    REM HP DC7800
    if "%#!computer@model_num%" =="0AA8h" set modelname=HP_DC7800
    if "%#!computer@model_num%" =="0AACh" set modelname=HP_DC7800
    if "%#!computer@model_num%" =="440BX Desktop Reference Platform" set modelname=VM_7

    if "%modelname%"=="none" (goto nomodelnumber) ELSE (goto installdrivers)
    goto exit

    : installdrivers
    echo on
    set server=%DSSERVER%.TOCATECH.LOCAL
    set share=express
    set drive=s:
    set domain=TOCATECH.LOCAL
    set user=ADMINISTRATOR
    set password=PASSWORD
    net use %drive% \\%server%\%share% %password% /user:%domain%\%user% /persistent:no
    start /w %drive%\MYDATA\drivers\Win7x32\dpinst.exe /path %drive%\MYDATA\drivers\Win7x32\%modelname%\
    net use %drive% /delete
    echo off
    goto exit

    :nomodelnumber
    echo on
    set server=%DSSERVER%.TOCATECH.LOCAL
    set share=express
    set drive=s:
    set domain=TOCATECH.LOCAL
    set user=ADMINISTRATOR
    set password=PASSWORD
    net use %drive% \\%server%\%share% %password% /user:%domain%\%user% /persistent:no
    copy %drive%\MYDATA\drivers\Win7x32\NO_DRIVERS.txt C:\NO_DRIVERS.txt /V /Y
    net use %drive% /delete
    echo off
    goto exit

    :exit
    echo Finished.
    exit



  • 4.  RE: imaging to remote sites using winpe

    Posted Sep 01, 2011 08:45 AM
      |   view attached

    You can do this a few different ways.  You can use conditions in the job to identify which drivers need to be injected, or you can do a large script that will identify the hardware and copy the appropriate drivers to the drivers folders identified in your sysprep file.  The first script below assumes you are using conditions in your jobs to identify the hardware and are also using WinPE x64 (you can modify this script to be used in WinPE x86 and DOS).  If you need a script for LinuxPE, I have one for that as well.

    i:\rdeploy\windows\x64\firm -recurse copy L:\t3500\* prod:\drivers
    i:\rdeploy\windows\x64\firm delete prod:\WINDOWS\system32\hal.dll
    i:\rdeploy\windows\x64\firm delete prod:\WIDNOWS\system32\ntkrnlpa.exe
    i:\rdeploy\windows\x64\firm copy L:\hal\halt3500.dll prod:\WINDOWS\system32\hal.dll
    i:\rdeploy\windows\x64\firm copy L:\hal\ntkrnlpat3500.exe prod:\WINDOWS\system32\ntkrnlpa.exe

     

    The attached file is an older script that I used to use when I was using DOS as an automation environment. You can modify it to work in WinPE fairly easily, just replace the firm references with the location of the correct firm file from your express\rdeploy share.  After you have modified the file for your needs, rename it to a bat file from a txt file.

    Attachment(s)

    txt
    hii2script_0.txt   9 KB 1 version