Remko Weijnen's Blog (Remko's Blog)

About Virtualization, VDI, SBC, Application Compatibility and anything else I feel like

Archive for June, 2008

I was working on an unattended installation of Citrix Presentation Server 4.5 or rather Citrix Xenapp. I was creating the dsn file for the installation by a script that uses the echo command and output this to a file.

This is a part of the script:

rem Create ODBC file
rem ———————————————————————–
echo [ODBC] > %ODBC%
echo UID=%SQL_SA% >> %ODBC%
echo Address=%SQL_SERVER%,1433 >> %ODBC%
echo Network=DBMSSOCN >> %ODBC%
echo LANGUAGE=us_english >> %ODBC%
echo APP=Citrix IMA >> %ODBC%
echo Description=Citrix Datastore >> %ODBC%
echo. >> %ODBC%

Even though the generated DSN file looks ok the installation fails. If you look in the installation log you can see this error: Error 26009. Could not Access the datastore using the DSN file.

I then created a dsn file through the ODBC Data Source Administrator and then the installation went ok. I compared the DSN file with the one my script generated and it was the same.

A search with Google and in the Citrix forums leads to numerous posts with the same error but none with a real solution. Some suggestions are that you need to remove the WSID line or even the order of the entries in the DSN file. But none of these suggestions work.

So I compared the two files again and I noticed that the filesize of my generated DSN was slightly bigger. So let’s look again at the script:


See the space right before the >>? This means that after each line in the dsn file there’s a space too. If you open the file with a Hex Viewer you can easily see the spaces (ASCII value 20):


So the solution is to change this (for all lines) to:


After that it works perfectly!

  • Filed under: Citrix, script
  • If you ever download software from Microsoft’s Volume Licensing Site you have probably seen that it uses the Akamai download manager. Sometimes your downloads get interrupted but how to restart the downloadmanager? There’s no entry in the startmenu and not even an icon on the desktop.

    You can restart the downloadmanager though by creating a shortcut to “C:\Windows\DOWNLO~1\CONFLICT.1\Manager.exe”. Please notice the short directory name (~1).

  • 1 Comment
  • Filed under: General
  • Configuring IBM Raid controller with Altiris

    Today I was deploying some IBM x3550 and x3650 servers with Altiris Deployment Server. IBM Delivers a toolkit for Altiris that contains amongst others jobs for configuring raid arrays.

    To do this you need to create a raid policy file and deploy this. I created this policy file:


    AppliesTo.1 = t:ServeRAID-8k-l,d:4

    Array_Mode = CUSTOM
    Array.A = 1,2
    Array.B = 3,4

    Logical_Mode = CUSTOM
    Logical.1 = A:FILL:1
    Logical.2 = B:FILL:1

    As you can see the policy only applies to the type of array controller in my servers (t:ServeRAID-8k-l). This way we prevent applying the policy to other configurarions. I have a 4 disk configuration (d:4) and want to create to RAID 1 arrays (A & B). On each array one Logical drive with the maximum size (FILL parameter).


    There are several patched terminal server dll’s floating around in the net to allow multiple concurrent Terminal Server session on Windows Vista with Service Pack 1. But they all have the same limitations:

    It’s not possible to start a session to Localhost, this is because the Terminal Server client does a check to see if you are running Personal Terminal Server (Vista/XP) and denies Localhost or if true ( works though).

    It’s not possible to start multiple sessions with the same user. The patch for Vista RTM did allow for this but in Service Pack 1 some Terminal Server code has moved to the Local Session Manager (lsm.exe) so we need to patch this file as well.

    Offcourse we need to patch Terminal Server to allow unlimited session on Vista as well.

    VPatch files are in the download link below.

    Vista SP1 Patches (7237 downloads)

    Terminal Server Ping Tool

    A while ago I included a new undocumented API into my JwaWinsta unit which is called WinStationServerPing. This API “pings” a Terminal or Citrix server and verifies that Terminal Server is up and running. It is not the same as a regular networking ping! This API actually makes a connection to a (remote) Terminal Server and verifies that Terminal Server runs and accepts connections.

    I wrote a small cmdline tool that uses this API to ping a Terminal Server which can be used to quickly determine if a Terminal Server is up and running. I named it WTSPing.

    So how does it work? Open up a command prompt (Start -> Run -> cmd) and type WTSPing /? to see the help:


    I needed a script to logoff all running Terminal Server sessions in order to rollout an install package. As you might know there is a commandline tool to logoff a session, it’s called logoff.exe.

    These are the commandline options:

    LOGOFF [sessionname | sessionid] [/SERVER:servername] [/V]

    sessionname The name of the session.
    sessionid The ID of the session.
    /SERVER:servername Specifies the Terminal server containing the user
    session to log off (default is current).
    /V Displays information about the actions performed.

    No option to logoff all sessions is there?

    On a Terminal Server there is a special session called the Listener session, you can see it with TSAdmin in the sessions tab:Listener

    A Listener is associated with a protocol (Microsoft RDP by default) and is used to setup new sessions. If you logoff a Listener session it will logoff all session that were created through it. Great, just what we need!

    So Logoff 65536 will do the trick? Let’s try:


    So Logoff is smart enough to ask for confirmation, we can prevent this by using the following commandline:

    Echo Y ! Logoff 65536