Remko Weijnen's Blog (Remko's Blog)

About Terminal Server, Citrix, Delphi and other stuff

Archive for the ‘script’ Category

Installers can create so called Advertised Shortcuts in the Start Menu. I wanted to check the Target Path of such an shortcut but Explorer doesn’t show it:

Microsoft Visio 2010 Properties | Shortcut Properties | Target Path

(more…)

  • 0 Comments
  • Filed under: script
  • imageI was testing a Script I wrote to launch a Citrix XenApp session using the Ica Client Object. Typical code to do this may look like this:

    Const cHttpBrowser = "someurl.local"
    Const cColorDepth = 4

    ‘ Create the ICA Client Object
    Dim objIca : Set objIca = CreateObject("Citrix.IcaClient.2")

    ‘ Set Credentials
    objIca.Username = "JohnDoe"
    objIca.SetProp "ClearPassword", "Secret01"
    objIca.Domain = "CONTOSO"

    ‘ Connection Settings
    objIca.BrowserProtocol = "HTTPonTCP"
    objIca.TransportReconnectEnabled = True
    objIca.HttpBrowserAddress = cHttpBrowser

    ‘ Session Settings
    objIca.Address = "MyApp"
    objIca.Application = "MyApp"
    objIca.DesiredColor = cColorDepth
    objIca.ScreenPercent = 0 ‘ Full Screen
    objIca.DesiredHRes = 0
    objIca.DesiredVRes = 0
    objIca.Launch = True

    ‘ Connect
    objIca.Connect

    On my testmachine it ran nicely but on a customer machine the script failed with the error 2312 “The Citrix online plug-in received a corrupt ICA File. The ICA File has no [ApplicationServer] section“:

    The Citrix online plug-in received a corrupt ICA File. The ICA File has no [ApplicationServer] section

    (more…)

  • 0 Comments
  • Filed under: Citrix, script
  • Embedding images in HTML

    I was creating a small dialog in an .hta file and to make a little prettier for the user I included a company logo:

    SNAGHTMLdfa805

    But I wanted to deploy the .hta as a single file.

    (more…)

    Remote Registry from 32 to 64 bit

    imageYesterday I needed to set a few registry keys remotely from a 32 bit windows machine to a 64 bit machine.

    I used reg.exe to set the key but even though it returned success the key wasn’t altered.

    As I suspected the key was written to the Wow6432Node. In the help I couldn’t find any switch to force reg.exe to use the 64-bit view.

    On a 64 bit machine this is not a problem since both 32- and 64 bit versions of reg.exe exists. The 32 bit version of reg.exe defaults to the 32 bit view and the 64 bit version defaults to the 64 bit view.

    But luckily reg.exe has a switch (that is not listed in the help) to force the View:

    I am currently deploying 64 Citrix XenApp servers with Altiris. The deployment consists of an OS Image, OS Configuration and finally Citrix XenApp and Applications.

    In the OS Configuration part the IP configuration needs to be applied and I decided to do this with a database.

    The database consists of 2 tables; one table with the per host settings and one table with the global settings (such as DNS).

    In the Altiris job both tables are read from an embedded VBScript and assigned to the NIC.

    Database configuration

    I created a database (SQL Server) called IPManagement with 2 tables:

    image

     

    (more…)

    As you may know, Fast User Switching (FUS) is not available (disabled) on Windows XP computers joined to a domain, Microsoft confirms this in kb280758.

    However, Microsoft doesn’t tell us there’s an undocumented registry value that allows us to have FUS when joined to a domain!

    To enable FUS you need to set the DWORD registry value HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\ForceFriendlyUI.

    It can also be set by Group Policy at HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System.

    When the value is set to 1, and LogonType key is also set to 1, it allows you to use a Friendly UI on a computer joined in a domain:
    (more…)

    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:

    $keyName = "SYSTEM\CurrentControlSet\Control\Terminal Server\Wds\icawd\thin16"
    $valueName = "MaxLVBMem"
    # Calculate your value! http://support.citrix.com/article/CTX114497
    [int]$value = 0xc00000

    # Set Identity to SYSTEM via it’s Well Known SID
    [System.Security.Principal.SecurityIdentifier]$ident = "S-1-5-18"

    # Open Registry Key (with Write Permissions)
    $regKey = Get-Item "HKLM:"
    $regKey = $regKey.OpenSubKey($keyName, $true)

    # Fetch Existing permissions
    $acl = $regKey.GetAccessControl()

    # Construct a new Ace
    $rights = [Enum]::Parse([Security.AccessControl.RegistryRights], "SetValue")
    $deny = [Enum]::Parse([Security.AccessControl.AccessControlType], "Deny")
    $rule = New-Object Security.AccessControl.RegistryAccessRule($ident, $rights, $deny)

    # Add the new Ace to the Acl
    $acl.AddAccessRule($rule)

    # Apply the new Acl to the Registry key:
    $regKey.SetAccessControl($acl)

    # Now set the required Value
    $regKey.SetValue($valueName, $value)

    # Close the key
    $regKey.Close()

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

    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:

    HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}

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

    Profile

    Recent Tweets

    Views