Remko Weijnen's Blog (Remko's Blog)

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

Archive for the ‘script’ Category

On a Citrix XenApp 5 environment a user reported that he was unable to start a Full Screen session on a Dual Monitor Configuration.

He received this error message:

foutmelding (2)

Citrix has a KB Article: “How to Allow More Memory for Session Graphics on Windows Server 2003” that explains exactly how we can solve this.

We need to change the MaxLVBMem registry value and we can use the Excel Sheet from the KB Article to calculate the proper value.

Please don’t set this value too high because a higher value means you will restrict other kernel memory pools.

You also need to deny the SYSTEM account the SetValue permission on the HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management key to prevent the Citrix IMA service from overwriting the new value.

So I wrote a small PowerShell script to change the permission and set the value:

Today I needed to script the installation of IBM System i Access for Windows (formerly called IBM Client Access).

With older versions of this client (up to 5.4) you could use the -r (record) installer switch to record the install in a setup.iss file but version 6.1 uses an MSI based installer.

IBM offers the client in a 2 DVD download but you probably only need the first dvd (dvd 1 has both the x86 and x64 installers, dvd 2 has the ia64 installer) which is a whopping 3,5 GB download.

Inside the download (a zip) is an iso file of which you will only need the files in the root and the Image32 or Image64a folder.

Inside the image folder are subfolders names MRI29xx where xx is a language identifier:

The following Identifiers are used: (more…)

  • 1 Comment
  • Filed under: Altiris, script
  • Yesterday I was packaging an application called Kluwer Juridische Bibliotheek. When the user first starts this application a screen with the License Conditions pops up and it must be accepted:

    KluwerEULA

    I always try to remove such things as I don’t think it’s necessary for every user to accept it.

    (more…)

    I usually change the text below the “This Computer” icon to reflect the current username and servername:

    UserOnComputer

    This is an ancient trick, just set the the LocalizedString Value of the following key:

    to “%USERNAME% on %COMPUTERNAME%”.

    It get’s a little more complicated if you want to set this from a script, because the environment variables are replaced with the actual value BEFORE they are entered in the Registry.

    (more…)

    Citrix Web Interface starts very slowly

    I remembered from a previous project that when the Citrix Web Interface this is caused by a setting called generatePublisherEvidence in the Aspnet.config file.

    This behaviour has been documented by Citrix in CTX117273.

    If you read it carefully you will see the note that you need to fix it in 2 places for an x64 system.

    If you know me a little than you have probably guessed I wanted to fix this with a nice script. I have chooses PowerShell this time because it has good support for XML and I made a one-liner so I can easily use it in an Embedded Altiris script.

    The script changes the config file for both x86 and x64:

    EDIT: If you run by commandline you need to care of quotes within quotes, easiest thing to do is to use double quotes (“) to surround the commandline and use single quotes (‘) for Strings inside the commandline:

    A while ago I created a script that I can run as embedded script in Altiris that creates a Server Manager Answer File (for Server 2008).

    I could have simply done an echo >answer.xml but I wanted a well formed XML that could be read and displayed in an XML editor or Internet Explorer when needed.

    I use the Microsoft.XMLDom object in the script the create the XML and I think the code is easy to understand so I will just show it here: (more…)

    I ran a VBScript that queries the Win32_Product WMI class on Windows 2003 but it returned error 0x80041010 instead of the expected results.

    I looked up that errorcode and it means WBEM_E_INVALID_CLASS. This happened because the “WMI Windows Installer Provider” was not installed.

    You can do this through Add/Remove Programs | Windows Components | Management and Monitoring Tools | WMI Windows Installer Provider.

    Or if you want to do this with a script you can use SysocMgr:

    Today someone asked questions about a script I wrote back in 2007 to solve a bug in Outlook (2003 but at least Outlook XP has the same issue). If you have access to someone’s calendar and want to make a print of it Outlook wants to print it in it’s default view which is a combined view on calendar appointments and tasks. However if you do not have permissions to the other persons tasks folder Outlook refuses to print and displays the following error: The messaging interface has returned an unknown error. If the problem persists, restart Outlook.

    To resolve it you can go to the Calendar | Daily View | Print, then click Page Setup and under Include Options deselect Taskpad. I didn’t want to do this for all users that’s why I wrote the script.

    (more…)

  • 0 Comments
  • Filed under: script
  • 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 DRIVER=SQL SERVER >> %ODBC%
    echo UID=%SQL_SA% >> %ODBC%
    echo Address=%SQL_SERVER%,1433 >> %ODBC%
    echo Network=DBMSSOCN >> %ODBC%
    echo LANGUAGE=us_english >> %ODBC%
    echo DATABASE=%CTX_DATASTORENAME% >> %ODBC%
    rem echo WSID=%COMPUTERNAME% >> %ODBC%
    echo APP=Citrix IMA >> %ODBC%
    echo SERVER=%SQL_SERVER% >> %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:

    echo DRIVER=SQL SERVER >> %ODBC%

    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):

    hexdump

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

    echo DRIVER=SQL SERVER>> %ODBC%

    After that it works perfectly!

  • 4 Comments
  • Filed under: Citrix, script
  • Encrypt RDP password in Python

    Dirk Schmitz send me his Python version of encrypting the RDP Password:


    Read the original article here: https://www.remkoweijnen.nl/blog/2007/10/18/how-rdp-passwords-are-encrypted/

    Donate


    Blogroll


    Categories


    Archives