How To: Silently Update the Management Gateway IP Address in the .0 File

Version 2

    If the public IP address of the LANDesk Management gateway is changed, this will break the ability of the clients to establish a secure SSL tunnel with the Management Gateway.

     

    The LANDesk Agent will use the hard coded gateway address contained in the .0 certificate file to establish the SSL tunnel.  If the gateway address is changed, then the client will fail to communicate with the new address on the gateway.  Setting up a DNS alias will fail as the client is hard coded to use the IP address.

     

    This will place clients in a broken state if they do not have the correct IP address in the .0 certificate file.

     

    This AutoIT script will update the .0 file on the client with a new IP address for the LANDesk Management Gateway.

     

    The script must be edited with the correct information, and then built into an EXE file using AutoIT.

     

    To download and install AutoIT, please go the the AutoIT website located here:

    http://www.autoitscript.com/autoit3/

    http://www.autoitscript.com/autoit3/

     

     

    #cs ----------------------------------------------------------------------------

    AutoIt Version: 3.3.0.0
    Author:         Chad Smith-Knott

    Script Function: Update the .0 certificate file with a new Gateway IP Address
        Template AutoIt script.

    #ce ----------------------------------------------------------------------------


    ;This section requires the name of the .0 file or files to be updated
    ;This is the .0 file located in the LDLOGON share on the core server

    $TextFileName = "c:\program files\landesk\shared files\cbaroot\certs\xxxxxxx.0"

    ;This IP Address is the old Gateway public IP Address
    $FindText = "255.255.255.255"

    ;This IP Address is the new Gateway public IP Address
    $ReplaceText = "10.10.10.10"

    $FileContents = FileRead($TextFileName)
    $FileContents = StringReplace($FileContents,$FindText,$ReplaceText)
    FileDelete($TextFileName)
    FileWrite($TextFileName,$FileContents)

    ;This section creates a broker.conf.xml file
    ;This file is used by the Gateway Remote Control and will be read before the .0 File
    ;Having this file present will protect clients from future IP Address changes on the gateway
    ;Insert the FQDN of your Management Gateway in the following section:
    <ipaddress>Your Gateway FQDN</ipaddress>

    $file = FileOpen("c:\program files\landesk\shared files\cbaroot\broker\broker.conf.xml", 10) ; which is similar to 2 + 8 (erase + create dir)

    FileWrite($file, "<?xml version=""1.0"" encoding=""UTF-8"" standalone=""yes""?><broker><proxyCredentials>Og==</proxyCredentials><ipaddress>Your Gateway FQDN</ipaddress><proxy/><order>0</order></broker>")
    FileClose($file)