Login to participate
Endpoint Management & Virtualization ArticlesRSS

How to Run Aclient in a Network Boot Disk or Network PXE Configuration in WINPE

viddect's picture

Running a Script on Client Computers with WinPE Boot Disk Configurations

The purpose for this article is to give you a unique alternative of running a script on Linux client computers when using with the Boot Disk Creator tool and configurations. In this article, we will address the situation where the computer will boot to a configuration created by the boot disk creator. One of the advantages of the boot disk creator is it maintains several different boot disk configurations for different types computers and network adapter cards. The boot disk creator configurations allow the client computer to boot to automation to image the computer. The computer can boot to a variety of different configurations where the computer will use a network boot media which can be a physical medium or a PXE network.

After the client computer boots you can run a script before the scheduled imaging job executes. The script detailed in this article allows you to execute the AClient.exe to communicate with the Deployment Server and run different jobs and tasks. A script can be created do an initial deployment, run assign jobs, or send inventory data to the Deployment Server.

INITIAL DEPLOYMENT:

Initial deploy is the process of having new computers communicate with the deployment server and run a set of instructions from the engine. These instructions can include configurations, jobs, and settings.

Use Initial Deployment to configure and deploy new computers booting to automation. Starting up a new computer with the Automation Agent lets you image the hard drive, assign IP and network settings, distribute personal settings and software, and install the Deployment Agent for new computers. Using Initial Deployment, you can associate new computers with pre-configured computer accounts.

In the script, you can take a network boot disk on portable media such as a USB drive and be able to run AClient.exe on the Linux client computers to connect to the deployment server.

This script has the following unique benefits:

  • Allows you to run any commands or utilities before AClient.exe executes or the scheduled imaging jobs are executed
  • Allows you to run an initial deploy
  • Allows you to check network connectivity before running the agent

On the Deployment Server put the following script targeting the Linux client computer in the \\server\express\agents folder. In my test scenario, I choose to call the script CopyScript.bat because the script copies the Altiris AClient.exe to the client computer and calls another script to install the AClient.exe and executes it on the client computers, enabling them to be managed by a Deployment Server. It enables clients to receive work from and report client status to the Deployment Server.

The following script is called CopyClient.bat:

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
copy f:\Agents\AClient\altiris-aclient-6.9.375.X86.exe x:\
x:
rename altiris-aclient-6.9.375.X86.exe aclient.exe
f:\Bootwiz\platforms\Winpe\x86\Templates\runagent.bat

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

In the first line the AClient is being copied down to the X drive in WINPE 2. I then change to the X drive and rename the AClient file to AClient.exe. In the fourth line the runagent.bat script file from the WINPE1.6 directory so the aclient.exe can be executed and not the DAgent. For the content details of the runagent.bat file, refer to the runagent.bat from the f:\Bootwiz\platforms\Winpe2\x86\Templates\runagent.bat.

The AClient program is normally installed and configured remotely from the Deployment Solution Console using the Client Install wizard, or the program is run at the client computer. However, you can use the following options to run it from a script file. (If you use a script file, see the following section on aclient.inp for information on using an import file to specify install switches for AClient.)

You can use the input file called Aclient.inp to set installation parameters for aclient.exe, so you can install the client program from a script file. The file is copied to the Deployment Server program directory when you install the product. Command-line parameters are included in the file, but are marked with a REM statement.

To use the input file, open it and remove the REM commands from the parameters you want to use. When you have the file set up the way you want it, you can run it by entering the file name as the first parameter after the aclient command. You can also put the same line in a script file if you want to run it from a file. Type:

aclient aclient.inp

NOTE: you can also add any command line switches for aclient into the batch file. To see more information on those commands see https://kb.altiris.com/display/1/articleDirect/ind...

In the runagent.bat there is different environment variables that are used by the script. Any of these variables can be enabled. To see more information on those variables see the following below.

REM ==============================================================
REM RunAgent=Run the agent
REM Version=6.9
REM Environment variables used by this scipt:
REM	ALTIRIS_PROCESSOR  The processor type to use for the agent
REM	ALTIRIS_SHARE    The path to the Deployment Share
REM	_RunAgentRemote   "" to run the local agent, otherwise run the remote agent
REM	_Agent        The path to the agent to run - "" will use the default path
REM	_Agent_cfgpath    Path to the agent config file (default = same as agent)
REM	_Agent_Persistent  Set to tell the agent its settings can be persistent
REM	_Agent_AutoUpdate  Set to tell the agent is can autoupdate itself
REM	_Agent_Lock     The parameters to pass to lock the agent
REM	_Agent_Params    Extra parameters to pass to the agent
REM	_ScreenLock     Set to tell the agent to run in locked mode
REM Most can also be passed as command line parameters in this order (currently ignored):
REM	1 = (Action: Start or Restart)
REM	2 = _RunAgentRemote
REM	3 = ALTIRIS_PROCESSOR
REM	4 = ALTIRIS_SHARE
REM	5 = _Agent_Persistent
REM	6 = _Agent_AutoUpdate
REM	7 = _Agent_Lock
REM	8 = _Agent_Params
REM --------------------------------------------------------------
:RunAgent
if not defined log if not defined __log if exist "%systemdrive%\__log__" set __log=%~dpn0.log
if defined log if not defined __log set __log=true& call %0 %* >>"%~dp0%log%" & set __log=& goto :eof
if defined echo (echo on) else if exist "%systemdrive%\__echo__" (echo on) else (echo off)
set __dbg=rem & if defined debug (set __dbg=) else if exist "%systemdrive%\__debug__" (set __dbg=) else (set __dbg=rem)

REM ==============================================================
REM Agent=Start AClient (as detached process)
REM Agent cmdline parameters are:
REM	-winpe    (tells agent to run in automation mode - no longer required)
REM	-persistent  (tells agent that it can make its settings persistent)
REM	-autoupdate  (allow autoupdate of the client)
REM	-lock     (lock keyboard)
REM Agent environment variables are:
REM	express    (drive letter where the Deployment share is (including the ":"))
REM	temp     (path to the writable scratch area is located (working directory))
REM	cfgdir    (path to the directory containing the input file)
REM --------------------------------------------------------------