ThinWorld Citrix Knowledgebase

Monday, 26 April 2010

Web Interface showing WFCRUN32 /? when clicking Icon in Firefox

I had a problem where Web interface could not be used with the mozilla Firefox browser.
When the application icon was clicked the WFCRUN32 help screen displayed instead of launching the application.

This problem occured for me on Web Interface 5.5 and Firefox 3.6.2 and the ICA client v11 and v12.

To correct this i needed to change the file type associations inside firefox to
Use Citrix (default) instead of ICA Client (inside firefox)

This option is under Tools, Options, Applications Tab inside firefox.

Web Interface SAVE AS ICA File

With Citrix Web Interface v5 or newer the ability to right click icons in web interface and select to SAVE AS has been removed.

This feature was handy as it saved an ICA file showing the connection information. This was great for troubleshooting Web Interface problems.

The customization in the following citrix Article describes how to re-enable this ability.

Friday, 23 April 2010

An Error (607) occured during the action Print

We had a problem with visio producing this error message when users print to A3 Paper.

this is a known issue when using Visio and the Citrix UPD. The resolution is to install SP3 for the visio product.

Tuesday, 20 April 2010

Microsoft Office Viewer File Associations

The following details the per user (HKCU) registry keys that manage the file associations for various office viewer products.

Setting these registry keys at a per User basis allows the delivery of office viewer software to certain users within the environment (eg. users with no licence)

Microsoft Word Viewer File Associations

HKCU\software\Classes\.dot\Content Type","application/vnd.openxmlformats-officedocument.wordprocessingml.document","REG_SZ
HKCU\software\Classes\.rtf\Content Type","application/msword","REG_SZ
HKCU\software\Classes\.docm\Content Type","application/","REG_SZ

Microsoft Excel Viewer File Associations


Microsoft PowerPoint Viewer File Associations

"HKCU\software\Microsoft\PowerPoint Viewer\12.0\EULAAccepted","1","REG_DWORD"

Microsoft Visio Viewer File Associations

"HKCU\software\Classes\.vsd\Content Type","application/","REG_SZ"
"HKCU\software\Classes\.vss\Content Type","application/","REG_SZ"
"HKCU\software\Classes\.vst\Content Type","application/","REG_SZ"
"HKCU\software\Classes\.vdx\Content Type","application/","REG_SZ"
"HKCU\software\Classes\.vsx\Content Type","application/","REG_SZ"
"HKCU\software\Classes\.vtx\Content Type","application/","REG_SZ"

Wednesday, 24 March 2010

HTA - A pretty looking HTA to Edit Text files

This is a smart looking HTA template that can be used for most anything.
The one i post here is for editing text files. I used this as part of a solution to control
software with device licences. The tool manages the list of device names that are allowed
to access software like Word and Excel.


HTA File :

Tuesday, 23 March 2010

Appsense Allow access to Network Drive executables

When using Appsense Application Manager to lockdown your environment you may well discover as i have that there is alot of executable code contained on network file shares.

The default Appsense Application Manager config only allows code to be executed from the fixed disks on your device. (eg. C:\ Drive)

To get round this blocking you can either add all the network paths to the "accessible item" list or do as i did and wildcard network shares with the rule \\*

NOTE : Best practice would be to get the code moved to a fixed disk on the server to improve performance. This solution would also prevent appsense from blocking it be default. In my case re-engineering the applications was not in scope of the task.

Wednesday, 17 March 2010

Find Excel Links Macro

This Excel Macro searches a specified path (eg: S:\Shared Documents)
for any Excel spreadsheets that contain links within them to other excel spreadsheets.

This is very handy for identifying spreadsheets that may be impacted by a move of the data share. Hardcoded path locations in spreadsheets may obviously stop working if data is moved to a new location.

Simply open the attatched spreadsheet in Microsoft Excel and follow the oncscreen form.


Thursday, 11 March 2010

VBS Ping check script

This simple VBS allow you to check a device is up and running (with a ping check) before it runs code against the device.

This method means your script will not hang running against machines that are powered off.

PINGFlag = Not CBool("ping -n 1 " & StrUserID(1),0,True))
If PINGFlag = True Then
' Machine is up and running
' Machine has not responded
End If


Audit Users Manually mapped Drive mappings

I needed to create a script to check to see if users had manually mapped network drives to a certain data share in order to perform a successful migration of the share to a new server.

Our central logon script would be easy to amend but obviously manually added mappings would not be effected by that. In our environment it is possible users have manually added a network drive on their local client device (workstation or laptop) or within their Citrix Xenapp sessions.

The drive mapping in citrix were easy to obtain as we have a hybrid profile solution and the drive mappings show as plain text files within their profile.

For Client Devices this task proved much more difficult and the scripts detailed here require scriping knowledge and some management. Also the data returned is reliant on a number of factors , most notable it can only check logged on users. (trying to rip apart NTUSER.DAT files proved fruitless the file is often locked and did not always seems to show the keys for reasons unknown)

Client Device check Script - You Feed the script a list of usernames and their workstation names and in a comma seperated file called workstation.csv
It will then output back to you if any of those users have the drive mapping you need to change. You can amend this script to FIND and REPLACE if required as well. The one posted here is an audit only to identify users who have the mapping.

(eg. User1,Workstation7

You must retrieve this in any manner you can, I had a list from SMS and also a report from edgesight showing me users and which workstations they had logged onto in the last 30 days.

Client Device check Script.VBS

On error resume Next

Set objShell = CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.fileSystemObject")

Const HKU = &H80000003
Dim StrArray(1000)
Dim StrDog, StrSplit, StrSID, StrText, StrText2, StrUserID, StrreplaceDrive

StrReplaceDrive = "\servername\sharename"

' Get AD group name and membership
StrGroup = Inputbox("Enter AD Group Name ")
Return = ("%comspec% /c h:\utils\DSGET group " & CHR(34) & "cn=" & StrGroup & ",OU=Data Access,OU=Groups,DC=thinworld,DC=netUK" & CHR(34) & " -members -expand | h:\utils\dsget user -samid -sid >members.txt" ,0,True)

Set objInputFile = objFSO.OpenTextFile("workstations.csv",1,False,-1)
Set objOutputfile = objFSO.CreateTextFile("Output.txt",2,True)

' Read the User IDs from file and then attach the SID on their PC to see the Drive mappings
Do While Not objinputfile.AtEndOfStream
Strtext = Ucase(objinputfile.ReadLine)
StrUSerID = Split(StrText,",")

' Check the machine is available before trying to read the registry
PINGFlag = Not CBool("ping -n 1 " & StrUserID(1),0,True))
If PINGFlag = True Then
Call READREG(StrUserID(0),StrUserID(1),StrSID(1))
objOutputfile.WriteLine StrUserID(1) & CHR(9) & "Computer Not Online"
End If

x = x + 1


' Display the output file
Return = ("%comspec% /c notepad.exe output.txt",0,False)
' End the Script

' Get the users SID Name
Set objInputFile2 = objFSO.OpenTextFile("members.txt",1)
Do While Not objinputfile2.AtEndOfStream
Strtext2 = objinputfile2.ReadLine
Pos = Instr(Strtext2,StrUserID)
If Pos > 0 Then
StrSID = Split(Strtext2,"S-1-5")
End If
End Sub

' Search the users registry for the drive mapping
Function READREG(StrUserID,Strcomputer,StrSID)
Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
Set WshSysEnv = ObjShell.Environment("PROCESS")
StrSID = Trim(StrSID)
strKeyPath = "S-1-5" & StrSID & "\Network"
strKeyName = "RemotePath"
objReg.EnumKey HKU , strKeyPath, arrSubKeys

For Each subkey In arrSubKeys
objReg.GetSTRINGValue HKU ,strKeyPath & "\" & subkey,strKeyName,szValue
intLength = Len(szValue)-1
strUncPath = Right(szValue, intLength)
If Ucase(StrUNCPath) = Ucase(StrreplaceDrive) Then
objOutputfile.WriteLine Subkey & " Drive Mapped to " & StrUNCPath & " By User : " & StrUserID & " On Client : " & Strcomputer
End If
End Function

Tuesday, 2 March 2010

Registry .REG backup Script

This Script reads in a .REG file and makes a backup of the registry area that the .REG will change when imported.

This is handy when you are given a .REG file and told to import it. The script will create backup .REG files for you to restore the machine to original values should the import cause issues.

Its not the prettiest of things and will create multiple backup REG files if there are multiple key paths. But you can highlight all the backup reg keys and import in the event of a restore.

' Backup Registry before importing a REG file
' This script is designed to be run before importing a .REG file
' It will export the current registry key values into a .REG file
' in order to make a restore to the original keys quick and simple.
' Input it a .REG file
' It will output to a folder of the same name a .REG file for each required Key

On error resume next

Set objFSO = CreateObject("Scripting.fileSystemObject")
Set WshShell = CreateObject("WScript.Shell")
Set objInputFile = objFSO.OpenTextFile(StrScript,1,False,0)

StrFolder = Wshshell.CurrentDirectory
StrScript = "tweak-bundle1.reg"
dim StrKey(1000)

StrPath = StrFolder & "\" & Left(StrScript,Len(StrScript)-4)

objFSO.CreateFolder (StrPath)

Do Until objInputFile.AtEndOfStream
i = i+1
strData = objInputFile.ReadLine
If Instr(Strdata,"[") > 0 Then
StrData = Left(StrData,Len(Strdata)-1)
StrData = Right(Strdata,Len(Strdata)-1)
StrKey(i) = Strdata
StrCommand = "REGEDIT /E " & CHR(34) & StrPath & "\" & i & ".reg" & CHR(34) & " " & CHR(34) & Strkey(i) & CHR(34)
Wshshell.Run Strcommand
End If