Deployment Solution

 View Only
Expand all | Collapse all

DS 7.1 PXE boot startup batch file show ipconfig/all

  • 1.  DS 7.1 PXE boot startup batch file show ipconfig/all

    Posted Feb 15, 2012 09:09 AM

    Hello.

    After a computer boots to pxe then runs the initial scripts, i would like this to show the result of an IP config command.

    Is there any way to have this display ipconfig/all command.

    I have looked into it a little and found

    startupnet.cmd

    startup.cmd

    I can see that startupnet calls startup.cmd

    do I just put the command in there?

    I performed a search for startup.cmd and it brought back the following directories.

    C:\Program Files\Altiris\Altiris Agent\Agents\Deployment\Task Handler\bootwiz\Configs\PXE x86\shared

    C:\Program Files\Altiris\Altiris Agent\Agents\Deployment\Task Handler\bootwiz\Platforms\Winpe2\x64\Templates

    C:\Program Files\Altiris\Altiris Agent\Agents\Deployment\Task Handler\bootwiz\Platforms\Winpe2\x86\Templatesp

     

    When I do a searchf or startupnet.cmd it brings back files in the followin directory.

    C:\Program Files\Altiris\Altiris Agent\Agents\Deployment\Task Handler\bootwiz\Platforms\Winpe2\x64\Templates

    C:\Program Files\Altiris\Altiris Agent\Agents\Deployment\Task Handler\bootwiz\Platforms\Winpe2\x86\Templates

    Thanks in advance.



  • 2.  RE: DS 7.1 PXE boot startup batch file show ipconfig/all

    Posted Feb 15, 2012 09:23 AM

    What exactly are you trying to accomplish?  There may be an easier way to handle that.



  • 3.  RE: DS 7.1 PXE boot startup batch file show ipconfig/all

    Posted Feb 15, 2012 09:56 AM

    To deploy images to new computer, i manually network boot the computers (f12 at boot), after they have done a network boot I press F8 then boot to PXE, the screen changes to an altiris automation screen and then a batch file runs in the background,

    I am after showing an ipconfig/all at this point so the helpdesk technician can find the machine in the console and deploy the image task to it.



  • 4.  RE: DS 7.1 PXE boot startup batch file show ipconfig/all

    Posted Feb 15, 2012 10:22 AM

    Why not use an Initial Deployment PXE menu?  It would have 'Image computer with Windows 7' as an option (or whatever).



  • 5.  RE: DS 7.1 PXE boot startup batch file show ipconfig/all

    Posted Feb 15, 2012 10:26 AM

    Hi, because I have created many client tasks that have many different jobs combined which have different builds and software, like x86 x32, laptop builds, desktop ect ect



  • 6.  RE: DS 7.1 PXE boot startup batch file show ipconfig/all

    Posted Feb 15, 2012 10:32 AM

    This being WinPE, I would imagine you could place a batch file in the "startup" folder.  I believe you would need to edit these boot images in Boot Disk Creator.

    Or I would assume you could do this via Initial Deployment.  I don't have a lot of experience in 7.x though.



  • 7.  RE: DS 7.1 PXE boot startup batch file show ipconfig/all
    Best Answer

    Posted Feb 15, 2012 01:28 PM

    Without going into a long drawn out explanation, you can use something like bginfo.exe to accomplish this.

    Basically, you can add bginfo.exe and the config file to "WinPE 2.x Additional Files" in the Boot Disc Creator.(C:\Program Files\Altiris\Altiris Agent\Agents\Deployment\Task Handler\bootwiz\bootwiz.exe)

    Use this link for information about BGInfo: http://technet.microsoft.com/en-us/sysinternals/bb897557

    Next, you would need to change your runagent.bat file in C:\Program Files\Altiris\Altiris Agent\Agents\Deployment\Task Handler\bootwiz\oem\DS\Winpe2\x86\Base and/or C:\Program Files\Altiris\Altiris Agent\Agents\Deployment\Task Handler\bootwiz\oem\DS\Winpe2\x64\Base

    This file is read-only by default, so first make a backup and then edit the file (after changing the attributes from read-only). This is the "batch file" you see running when the Automation screen first appears.

    Add a command like the following into the batch file

    ECHO Starting BGInfo
    "%systemdrive%\bginfo.exe" /i"%systemdrive%\<YOUR CONFIG FILE NAME HERE>.bgi" /silent /nolicprompt /timer:0

    I like to put that command towards the end of the script but before the pectacgent is started.

    Thats it, save the runagent.bat, Recreate your Preboot from the console, and enjoy having some more information displayed in Automation.



  • 8.  RE: DS 7.1 PXE boot startup batch file show ipconfig/all

    Posted Feb 15, 2012 04:13 PM

    Thanks all for your replies and comments.

    Donald_noah, great answer, i will certanly try this tomorrow, i wasnt even aware that this was possible. Kudos.



  • 9.  RE: DS 7.1 PXE boot startup batch file show ipconfig/all

    Posted Feb 16, 2012 05:54 AM

    excellent advice. thank u !!!! great solution.



  • 10.  RE: DS 7.1 PXE boot startup batch file show ipconfig/all

    Posted Feb 21, 2012 12:17 PM

    with regards to having bginfo on the automation screen. one thing ive noticed about this, the clients seem to get two minint names, the first is a fqdn and the other is a workgroup, both show the same IP address but display different mini nt names.

    is there a way to overcome this so that it will just show either the fqdn like minint-89078.company.com

    or the workgroup name

    thanks.



  • 11.  RE: DS 7.1 PXE boot startup batch file show ipconfig/all

    Posted Feb 27, 2012 01:23 PM

    Thanks for sharing this Donald, it's exactly what I've been looking for!

    My addition:
    If you want to display the machine name as it's known in the Management Platform you can get this by parsing the Agent.log file in \Program Files\Altiris\Altiris Agent\Logs\Agent.log. The script below will do this for you, hopefully it doesn't require any tweaking to get working. Note: For this to work BGInfo has to start 10 to 12 seconds AFTER the pectagent in runagent.bat.

    Steps:
    Copy the code at the end of this post into a vbscript file.
    Copy the vbscript and bginfo.exe onto a thumb drive.
    Boot a machine into the WinPE environment and connect the thumb drive.
    Copy the vbscript and bginfo.exe to the WinPE system drive, the results of environment variable %systemdrive%. (X: for me). Note: if this is not X: change the drive letter in the vbscript path as well.
    Open bginfo and create a custom field that uses the vbscript. Configure everything you want bginfo to do and then save a bgi file to X:. Click Apply in bginfo to test.
    Copy the vbscript and bgi file to the thumb drive.
    On a machine running bootwiz.exe add the vbscript, bgi file and bginfo.exe to the WinPE 2.x additional files.
    Modify the runagent.bat that Donald mentioned previously with the following.
    (At the end of the batch file):
    ECHO Starting BGInfo... Please wait...
    %systemdrive%\await 12
    "%systemdrive%\bginfo.exe" /i"%systemdrive%\WinPE.bgi" /silent /nolicprompt /timer:0

    You could also use the /timer instead of await to get the necessary delay but I prefer to keep bginfo from displaying.
    Recreate the preboot environment from the web console.


    Const ForReading = 1

    Set objRegExp = New RegExp
    objRegExp.IgnoreCase = True
    objRegExp.Global = True
    objRegExp.Pattern = "IsPredefined=\""True|False\""  Name=\""([a-z0-9-_]+)\"""
    strAgentFile = "X:\Program Files\Altiris\Altiris Agent\Logs\Agent.log"

    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objTextFile = objFSO.OpenTextFile(strAgentFile, ForReading)
    Do Until objTextFile.AtEndOfStream
        strNextLine = objTextFile.Readline
        Set Matches = objRegExp.Execute(strNextLine)
        If Matches.Count > 0 Then
            strComputer = Matches(0).SubMatches(0)
            Echo "" & strComputer
        End If
    Loop