Jan 18

SCCM set a custom variable dependency using Powershell or Vbs

Stef DriessenComments Off on SCCM set a custom variable dependency using Powershell or Vbs

When you are a frequent user of SCCM, sooner or later you will want a custom variable on which u can set a dependency for jobs further on in the task sequence.

After searching online for a while and not finding a satisfying answer I decided to create a short how-to.

Continue reading »

Mar 19

Scriptable Citrix Password Encoder

Remko WeijnenComments Off on Scriptable Citrix Password Encoder

A while ago I published a tool to Encode and Decode Citrix passwords. Today I am publishing a small update to this tool that makes it scriptable by adding a COM interface.

If you start the tool without parameters you will get the GUI, just like before:

Encrypt | Decrypt Password | Hash | Citrix | Ctx1

To use the COM interface you first need to register the executable with the /regserver switch:

CtxPass /RegServer

After the registration you can call it using any language that supports COM. To get you started I wrote a few examples

Continue reading »

Mar 13

MSCOMM32.OCX returns error 80040112

Remko WeijnenComments Off on MSCOMM32.OCX returns error 80040112

Yesterday I wrote about troubleshooting an application that used Com Port redirection in Citrix.

During the troubleshoot I noticed that the application used an ActiveX component, MSCOMM32.OCX, for serial communication.

I wanted to quickly test if the component was correctly registered so I searched the registry from HKEY_CLASSES_ROOT for mscomm32.ocx.

Continue reading »

Feb 14

Script to Get Computer OU

Remko WeijnenComments Off on Script to Get Computer OU

Just some quick code to get the OU Name of the computer we run the script on.

VBS:

Function GetComputerOU
	Dim objSysInfo: Set objSysInfo = CreateObject("ADSystemInfo")
	Dim objComputer: Set objComputer = GetObject("LDAP://" & objSysInfo.ComputerName)
	Dim objOU : Set objOU = GetObject(objComputer.Parent)
	GetComputerOU = objOU.OU
End Function

Wscript.Echo GetComputerOU

PowerShell:

function GetComputerOU
{
	$SysInfo = New-Object -ComObject "ADSystemInfo"
	$Computer = [ADSI]("LDAP://{0}" -f $SysInfo.GetType().InvokeMember("ComputerName", [System.Reflection.BindingFlags]::GetProperty, $null, $SysInfo, $null))
	return ([ADSI]$Computer.Parent).OU
}	

GetComputerOU
Jan 18

Get the location of an advertised shortcut

Remko WeijnenComments Off on Get the location of an advertised shortcut

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

Continue reading »

Dec 21

VMware ThinApp package crashes with VBS.

Andy BarendregtComments Off on VMware ThinApp package crashes with VBS.

For the intergration of VMware ThinApp applications into RES Workspace Manager, a custom VBS is required in the root of the Setup Capture files folder.
The following code must be present in the script:

Function OnFirstParentStart
WaitForProcess ExecuteVirtualProcess(GetEnvironmentVariable(“pwrgrids”)),0
End Function

But some ThinApp applications failed to start after that, or any vbs script was added to the build.

Continue reading »

Dec 13

Citrix online plug-in received a corrupt ICA File

Remko WeijnenComments Off on Citrix online plug-in received a corrupt ICA File

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

Continue reading »

Sep 01

VBScript vs PowerShell

Remko WeijnenComments Off on VBScript vs PowerShell

imageI am converting an old VBScript to PowerShell and it’s very nice to see how many lines of code in VBS can be written in one line of (much better readable) code in PowerShell.

Continue reading »

Apr 29

Apply IP Configuration from a Database

Remko WeijnenComments Off on Apply IP Configuration from a Database

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

 

Continue reading »

Apr 04

Search XML Files

Remko WeijnenComments Off on Search XML Files

In a  VB Script I am writing I needed to read an XML file and read a GUID from it.
The XML file looks like this (there’s more data in it, I am just displaying a small piece so you can see the structure):



  
    7af322bd-9c0c-4edb-a55d-97f4b240abf2
    DesktopSiloEven
    fa341079-5376-4baa-8898-1048421506df
    12a072bb-9338-418a-9be1-e0e9c8ed2780
    77d73762-745d-49f3-8cb3-6b7fedaf70a2
    3f5b59a9-1989-43b7-9354-871841aa65a8
    37bdf4a7-1ca6-a7eb-0d4e-ec3e964c73bd
  
  
    550f45d9-4b22-430d-b972-06671f4da7cb
    DesktopSiloUneven
    fa341079-5376-4baa-8898-1048421506df
    12a072bb-9338-418a-9be1-e0e9c8ed2780
    bf263ad1-3c89-4503-a82f-81e1dc909efb
    3f5b59a9-1989-43b7-9354-871841aa65a8
    37bdf4a7-1ca6-a7eb-0d4e-ec3e964c73bd
  

I needed to lookup the value of the GUID Node of the NodeGroup with a specific name. We could do this with a classic for loop, enumerating all nodes, enumerate it’s children etc.

But there’s a much simpler way using a search filter:

Set xmlDoc = CreateObject("Msxml2.DOMDocument")
xmlDoc.load("dnkemss.xml")
GuidEven = xmlDoc.selectSingleNode"/dsDASe/NodeGroup[Name='DesktopSiloEven']/GUID").text
GuidOdd  = xmlDoc.selectSingleNode("/dsDASe/NodeGroup[Name='DesktopSiloUneven']/GUID").text


Remko Weijnen