1 Reply Latest reply on Feb 18, 2011 4:38 PM by Bhanson

    Make the ldscnhlp.ini file point to preferred server

    Rookie

      I have an 8.8 environment where I configured the ldscnhlp.ini file to be included with the agent distribution.  I had the INI kick off a vb script, which was located on the core server, then the vbscript would gather a bunch of junk like drac, pending reboot, query a SQL db for server owners etc. and dump that information into a DAT file that is passed back to the inventory server.

       

      A shortcoming of this approach is that our DMZ devices didn't have access to pull that vbscript due to a one way trust across domains, and the inventory service being kicked off by the System account.  I'm currently working on standing up a preferred server in the DMZ, but I need a way to tell the ini file to look to it.

       

      I could simply list off all the prefered servers, but that limits the ability to modify my prefered servers without distributing a new INI file to each managed node.

      My other option is to put the file on the prefered server in the DMZ so that I could utilize the one way trust and allow access to all devices... but I'd really like to know if the following is an option as it seems like a better practice.

       

      Is there a variable I can use to retrieve the prefered server in the ldscnhlp.ini instead of having to hard code it?  In the example below I'd like to replace 'SERVERNAME' with %PreferredServer% or execute something to pull the preferred server that the node should be using.

       

      ldscnhlp.ini

      [EXECUTE WIN16]

      [EXECUTE WIN32]
      LAUNCH1=cscript "\\SERVERNAME\ldlogon\CustomData\Scripts\ExtraInfo\ExtraInfo.vbs"
      TIMEOUT1=600

      [EXECUTE WIN64]
      LAUNCH1=cscript "\\SERVERNAME\ldlogon\CustomData\Scripts\ExtraInfo\ExtraInfo.vbs"
      TIMEOUT1=600

      [DATA FILES]
      DATANOPREPEND1=C:\Program Files\LANDesk\LDClient\ExtraInfo.DAT
      DATANOPREPEND2=C:\Program Files (x86)\LANDesk\LDClient\ExtraInfo.DAT
      DATA3=C:\Program Files\LANDesk\LDClient\LDCUSTOM.DAT
      DATA4=C:\Program Files (x86)\LANDesk\LDClient\LDCUSTOM.DAT

        • 1. Re: Make the ldscnhlp.ini file point to preferred server
          Rookie

          This is my solution so far.

           

          I need to include the following files in my Agent distribution:

               ldscnhlp.ini

               localExtraInfo.vbs - for calling a Production script

               localExtraInfo-Test.vbs - for calling a Testing script

           

          ldscnhlp.ini calls localExtraInfo.vbs which parses through the local Program Files\LANDesk\LDClient\sdmcache\PreferredServers.xxx.dat file to get the prefered server.  Then kicks off the script located on the prefered servers.

           

          ldscnhlp.ini

          [EXECUTE WIN16]

          [EXECUTE WIN32]
          LAUNCH1=cscript "C:\Program Files\LANDesk\LDClient\localExtraInfo.vbs"
          TIMEOUT1=600

          [EXECUTE WIN64]
          LAUNCH1=cscript "C:\Program Files (x86)\LANDesk\LDClient\localExtraInfo.vbs"
          TIMEOUT1=600

          [DATA FILES]
          DATANOPREPEND1=C:\Program Files\LANDesk\LDClient\ExtraInfo.DAT
          DATANOPREPEND2=C:\Program Files (x86)\LANDesk\LDClient\ExtraInfo.DAT
          DATA3=C:\Program Files\LANDesk\LDClient\LDCUSTOM.DAT
          DATA4=C:\Program Files (x86)\LANDesk\LDClient\LDCUSTOM.DAT


          localExtraInfo.vbs

          Option Explicit
          Dim fs,ws

          Set fs = CreateObject("Scripting.FileSystemObject")
          Set ws = CreateObject("WScript.Shell")

           

          Dim oFolder, colFiles, oFile, readFile
          If fs.FolderExists("C:\Program Files (x86)\LANDesk\LDClient\sdmcache" Then
          Set oFolder=fs.GetFolder("C:\Program Files (x86)\LANDesk\LDClient\sdmcache")
          Else
          Set oFolder=fs.GetFolder("C:\Program Files\LANDesk\LDClient\sdmcache")
          End If

           

          Set colFiles=oFolder.Files

          For Each oFile In colFiles
          If Left(UCase(oFile.Name),17)="PREFERREDSERVERS." Then
            Set readFile = fs.OpenTextFile(oFile.Path, 1, False)
          End If
          Next


          Dim sPreferredServer
          sPreferredServer=UCase(readFile.ReadLine)

          If sPreferredServer = "" Then
          sPreferredServer="DefaultServerName.FQDN.com"
          End If

          sPreferredServer=Right(sPreferredServer,Len(sPreferredServer)-InStr(sPreferredServer,"US")+1)
          readFile.Close

          ws.Run "cmd /c cscript ""\\" & sPreferredServer & "\ldlogon\CustomData\Scripts\ExtraInfo\ExtraInfo.vbs"""


          Thanks to Chad Smith-Knott for the reccomendation.