5 Replies Latest reply on Oct 13, 2011 7:35 AM by EMiranda

    WinPE preferred Server




      Is there a way to have the preferred Server information into WinPE?

      I would like to use them via some script to get the source from the correct server...


      Many thanks



        • 2. Re: WinPE preferred Server

          Hi Zman,


          Thanks you for reply... Always on the lookout ;-))

          I'm using LDMS v9SP2...


          I have read some article that explain, like Jan, if you run the sdclient, it will automatically generate the preferredserver.dat...

          The problem is on the WinPE 9 SP2 it doesn't work. Even if I run manually the sdclient command, the preferredserver.dat file is never created, and of course I have a preferred server that works on a normal client ;-)

          If I use the tools from Jan, prefmap, I receive a error message saying that the preferredserver.dat file doesn't exists...


          Any idea ;-)



          PS: I will also ask into the Jan's discussion that you send me.

          • 3. Re: WinPE preferred Server

            Hey Lionel.  We recently rebuilt our LANDesk core and applied all the latest patches and fixes.   Since doing that, we're having the same issue.  Through a little troubleshooting, I found that adding "/attemptpref" to the end of the command Jan uses in her exe to download a dummy file will cause the creation of the preferredservers.dat file.  You'll need to install AutoIt, edit the file with that command, then recompile it and update your copy.  If you have questions, let me know.

            • 4. Re: WinPE preferred Server
              kleong Apprentice

              Hi Lionel,


              This was how I achieved it.


              Create a dummy file named whatever you would like, I named mine "LocalPreferredServer.dat" on the server located here SERVER\Images\Tools

              Location: SERVER\Images\Tools

              Filename: LocalPreferredServer.dat


              Create a batch script file (.bat or .cmd) with these contents.

              Location: SERVER\Images\Tools

              Filename: GetPreferredServer.cmd

              Batch File Contents:

              FOR /F "delims=?; tokens=2" %%i IN (%SystemDrive%\ldclient\preferredservers.dat) DO SET LocalPreferredServer=%%i

              ECHO %LocalPreferredServer% > x:\preferredserver.txt


              LANDesk Provisioning Template:

              Action Type: Execute

              Target Path: %%SYSTEMDRIVE%%\ldclient\sdclient.exe

              Command-Line Parameters: /p="\\%corename%\Images\Tools\LocalPreferredServer.dat" /dest="%%SYSTEMDRIVE%%\LocalPreferredServer.dat" /requirepref /showprogress /preservedir

              Working Directory: %%SYSTEMDRIVE%%\ldclient


              Action Type: Copy

              Source Path: \\%corename%\Images\Tools\GetPreferredServer.cmd
              Destination Path: %%SYSTEMDRIVE%%\


              Action Type: Execute

              Target Path: %%SYSTEMDRIVE%%\GetPreferredServer.cmd



              The batch script will create a text file with the preferred server under X:\preferredserver.txt

              Or alternatively, you could use SetX to set it as an environmental variable and use it that way (I have not tested this method as I just mapped a network drive to it).