Client Management Suite

 View Only

Replicating Deployment Server Job Source Files and Installing From the Nearest Server 

Dec 17, 2010 10:41 AM

While there have been several methods discussed in various forums, this method works well for us, so I thought I’d post it in the hopes it may be beneficial to someone else.

Because our client machines are spread out across multiple remote sites, we have the need to be able to install software utilizing the Deployment Server in such a way that we minimize impact on our WAN connections.  Our DS infrastructure is comprised of one Deployment Server at our primary data center and three PXE servers at remote locations to support our imaging needs.  Leveraging the existing PXE servers, we created “application shares” on each one, and we replicate our centralized application repository to each on a nightly basis using the free Microsoft utility Robocopy.

For example, we create a Scheduled Task on a PXE server to run the batch file below:

 "D:\Program Files\Altiris\eXpress\Deployment Server\robocopy\robocopy.exe" "\\SERVERNAME\applications" "d:\applications" /E /R:1 /W:5 /NP /NFL /NDL /PURGE /LOG+:PXESERVERNAME_applications.log 

So now any adds/deletes/updates made to the centralized application repository are replicated to each PXE server at the scheduled time nightly.  Now how do we configure our DS jobs to determine which server to use?  We call a vbscript at the beginning of each job that uses the client machine’s IP address to determine which server to pull from. 

 Option Explicit
On Error Resume Next 

Dim strComputer, strServer
Dim objWMI, objIPConfig, objNetwork
Dim colIPConfig
Dim i

'Set strComputer variable as this machine
strComputer = "."

'Define WMI object
Set objWMI = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\"& strComputer & "\root\cimv2")

'Pass results of WMI query to objIPConfig variable
Set objIPConfig = objWMI.ExecQuery("Select IPAddress from Win32_NetworkAdapterConfiguration Where IPEnabled=TRUE")

'Determine client's IP address and assign appropriate application server
For Each colIPConfig In objIPConfig
   If Not IsNull(colIPConfig.IPAddress) Then
      For i=LBound(colIPConfig.IPAddress) To UBound(colIPConfig.IPAddress)
                     If Not Is Null(colIPConfig.IPAddress(i)) And colIPConfig.IPAddress(i) <> "0.0.0.0" Then
                           If InStr(colIPConfig.IPAddress(0), "179.1.17.") Then
                                  strserver = "SERVERA"
                           ElseIf InStr(colIPConfig.IPAddress(0), "179.1.18.") Then
                                  strserver = "SERVERB"
                           ElseIf InStr(colIPConfig.IPAddress(0), "179.1.19.") Then
                                  strserver = "SERVERC"
                           Else
                                  strServer = "SERVERX"
                           End If
                     End If
      Next
   End If
Next

'Map V: to application share
Set objNetwork = CreateObject("WScript.Network")
objNetwork.MapNetworkDrive "V:", "\\"+ strServer + "\Applications",, "USERNAME", "PASSWORD" 

  

In the subsequent tasks in the DS job we make sure that, instead of referencing a specific server, we simply reference the v: drive.

For cleanup purposes, we also delete the drive mapping at the end of each job.

 net use /delete v: 

Statistics
0 Favorited
0 Views
0 Files
0 Shares
0 Downloads

Tags and Keywords

Related Entries and Links

No Related Resource entered.