Archive

Archive for the ‘RES’ Category

Citrix XenApp Mobility pack & RES Workspace Manager, lets fix those issues!

Late last year Citrix announced the availability of the XenApp 6.5 mobility pack. This mobility pack allows more native gestures to tablet users within their desktop session. Having testing it first hand, its really, really cool, but has a few issues to be aware of.

Firstly, it tends to enumerate hidden drives like c: or whichever drives you hide with Group policy, Kees Baggerman blogged about this issue a number of weeks ago:





and to confirm, there is definitely a private hotfix available for this. My own call reference with Citrix was SR60726532 if you wish to log a call yourself and receive the hotfix, you can quote this number.

The hotfix itself is just a binary replacement for the touchoptimizedDesktop.exe file in c:\program files (x86)\citrix\system32.

Secondly, the Mobility pack’s start menu will enumerate both the local start menu and the users controlled start menu via RES Workspace Manager.


*red applications shouldn’t be visible



This presents a show stopper as the user is able to launch local applications they are not assigned without the security rules assigned. I logged this with both Citrix and RES. Citrix politely told me to PFO and RES agreed to log a feature request to add support.

If like me, you’d prefer a workaround while RES work their magic, Follow the below steps:

modify the permissions to the default start menu (c:\programdata\microsoft\windows\start menu):





Modify the ACL’s on the Programs folder as follows, ensuring to remove the users group and everyone group from the acl:




After doing so, the users start menu inside of the Mobility pack, should be correctly populated:




And that should be it, your fondleslab users should now be able to experience the XenApp mobility pack in all its glory!

Forcing a XenApp Application to open with the Citrix Desktop Viewer using the Default.ica

February 15, 2012 2 comments

This post is just a quick FYI for use with ThinKiosk. This also works great with RES Workspace Manager desktop’s published as applications. Although RES no longer recommend using the publishing option in RES, many customers still use Workspace Manager as a published application.

The Citrix Desktop Viewer adds great functionality to users, allowing users to configure preferences, send [Ctrl] [Alt] [Del], quickly jump between fullscreen and windowed mode etc.

To force an application to open using the Desktop viewer, add the following code to your default.ica file:

[RES PowerFuse Desktop - RESPF]
connectionbar=1
TWIMode=Off

Where “RES PowerFuse Desktop – RESPF” is your application name.

this will appear as below:

Replacing Windows Devices and Printers with RES Workspace Manager PowerPrint

January 29, 2012 14 comments

This post is with thanks to @patrickdamen for the great idea of using a building block and @antonvanpelt for taking time from his busy weekend to test the fix, thanks gents!

So one of the great features of RES Workspace manager is PowerPrint. Powerprint, among other things allows for you to map printers and track preferences depending on your location. Powerprint is so powerful most administrators will remove users ability to use the native windows functionality in favour of this tool.

A downside to the latest incarnation of Workspace manager is that PowerPrint is quite hard to find for the users, instead of being on the root of the Windows xp style start menu, its not moved down two tiers into the Workspace manager start menu folder on the windows 7 style desktop.

With the attached building block, you can replace the native windows shortcut to “Devices and Printers” with a link instead to powerprint!

This building block works by hacking and taking over the Class ID for Devices and Printers and populating the class id with entries for PowerPrint. In order to use this building block, follow my previous blog post on how to hide the Windows “Devices and Printers” from the users.

The great thing about this hack, is it reuses native windows functionality the user will be used to and makes powerprint much easier to access by the user. That being said, I’m not sure RES will be enthusiastic with this hack, so use it at your own risk.

The (32 bit) addition to the name is a bit of a mystery at the moment, I’ve a call open with RES and I suspect its wow6432 related.

Download the building block here:

Removing users access to “Devices and Printers” in a Server 2008 R2 / Win 7 Environment.

January 27, 2012 1 comment

I love a good challenge. Recently I read the following article from Microsoft about how to tackle the title of this blog. This hack didn’t actually stop the users from accessing the cpl as clever users will just use rundll32 to get around the limitation. This also knocked other “show the following control panel items” policies out.

This really inst a huge issue to most environments, as users will probably want to enumerate their printers at one stage or another. But in a RES Workspace manager environment, RES provide a much better interface for printer management which really defunct’s and eliminates the need for the windows method.

The culprit can be seen below:

This problem for me, all stems from the “NoSetFolders” chestnut, anyone who’s tried to lock down a Terminal services environment from Windows Server 2000 onwards will be aware that this “handy” group policy removes the users ability to use [Windows Key] and [E] to open explorer. This issue still isn’t fixed in 2008 R2 and I’m beginning to think Microsoft just wont fix it. Hey no big deal right? Yes, quite a big deal if you ask pedantic users.

Anyway, I digress. Once you remove the NoSetFolders key, the user has the ability to see the devices and printers as below on the start menu, hence my situation.

To remove this folder view for all users, its time to hack the registry!

The Class ID belonging to this start menu item can be found here:

HKEY_CLASSES_ROOT\CLSID\{A8A91A66-3A7D-4424-8D24-04E180695C7A}

This dastardly key also has a 32bit relation that can be found here:

HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{A8A91A66-3A7D-4424-8D24-04E180695C7A}

As with my previous post about removing screen resolution and personalise, its just a matter of removing the users ability to see this registry key.

So below you will find the steps to take to remove this item:

  1. Take a backup of this key, you’ll thank me if you get it wrong!
  2. Browse down to HKEY_CLASSES_ROOT\CLSID\{A8A91A66-3A7D-4424-8D24-04E180695C7A}
  3. right click this key, choose permissions, click advanced then owner
  4. Select administrators from the list, then choose “Apply”.
  5. browse to the permissions tab and remove the “users” group. (you may need to remove inheritance)
  6. Click “apply”, then “ok”.
  7. Repeat step 2 to 6 on HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{A8A91A66-3A7D-4424-8D24-04E180695C7A}
  8. Tada! go grab a coffee to celebrate your domination over the windows operating system.

And that’s it, even if the user tries to view the option theres a blank place on the start menu where devices and printers should be. Check back next week and I’ll show you how to replace this shell icon with PowerPrint from RES software.

PS: You can also quite easily script this, Remko provided me with a great script that I’ve modified below to suit this purpose.

Read more…

Reporting RES Workspace Manager realtime licensing with PowerShell.

November 1, 2011 3 comments

This is an old script I use internally but I had somebody ask me how I was doing it at Citrix Synergy. I figured if they needed it why not share the script.

Finance departments love interval based licensing reports, to get snapshots of usage as the day goes by. From this they like to draw trends and watch out for closing in on capacity.

We could get this reporting quite easily with Citrix’s LMSTAT.exe utility but RES did not offer a similar product. A quick support call later, the following SQL statement was shared with me to report committed licenses:

"select count(strLicenseType) as LicenseCount from dbo.tblLicenses where strLicenseType ='HARD'"

Using the above command as an SQL query will return the currently in use licenses from your Workspace Manager Database.

Taking this a step further, we needed to retrieve this number every 15 minutes and report to excel. I used powershell to achieve this with the least administrative work. Below is the Powershell function I wrote to achieve this task. This script connects into the database you specify, runs the sql query and returns the license count:

Function get-RESlicensecount{
    param(
        [Parameter(Mandatory = $true)]
          [String]$server,
          [Parameter(Mandatory = $true)]
          [String]$database,
          [Parameter(Mandatory = $true)]
          [String]$username,
          [Parameter(Mandatory = $true)]
          [String]$password
    )#end param

    $SqlQuery = "select count(strLicenseType) as LicenseCount from dbo.tblLicenses where strLicenseType ='HARD'"
    $SqlConnection = New-Object System.Data.SqlClient.SqlConnection
    $SqlConnection.ConnectionString = "Server=$Server; Database=$database; user id=$username ; Password=$Password ; Trusted_Connection=False"
    $SqlCmd = New-Object System.Data.SqlClient.SqlCommand
    $SqlCmd.CommandText = $SqlQuery
    $SqlCmd.Connection = $SqlConnection
    $SqlAdapter = New-Object System.Data.SqlClient.SqlDataAdapter
    $SqlAdapter.SelectCommand = $SqlCmd
    $DataSet = New-Object System.Data.DataSet
    $SqlAdapter.Fill($DataSet) | out-null
    $SqlConnection.Close()
    $result=($dataset.tables[0] | select-object licensecount).licensecount
    Return $result
}

get-RESlicensecount -server "SQLServerName" -Database "DatabaseName" -username "Username" -password "Password"

The output of the command should simply list the number of committed licenses for you to report / ammend as you wish:

Drop me a comment if you need the additional excel component. It’s much longer and fairly unique to our implementation.

Enabling & Disabling RES WM / Powerfuse tracing with Powershell

October 14, 2011 1 comment

Happy scripting Friday!

I wrote this script in batch donkeys ago and have been looking for a good excuse to rewrite it in PowerShell. Today was that day!

Here is two very simple powershell functions to enable and disable tracing for either WorkSpace Manager or Powerfuse on x86 or x64 platforms. Theres also tons of checks for funny business.

Update:

Thanks to Dennis Van Dam from RES Software for the tip that the users must be able to write to the tracefile, I’ve updated the scripts to include setting the ACL and I’ve also packaged the scripts as an importable module. You can download this new file below.

The script enables logging by default to c:\restrace.log and doesn’t delete the file after you disable tracing to ensure you send it to the experts.

The script will:

  • check for x64 or x86 architecture
  • Check if we’re running Workspace Manager or Powerfuse
  • create / delete the keys
  • Set the needed acl
  • Restart the service

At present this script can be run on remote systems using powershell remoting, if you want a native remote script without remoting dependencies just request it and I’ll start working on it. I had attempted something in visual studio a year or so ago and got sidetracked (bored).

Importing the module:

To import the module, simply run the below command (where $path is the path to the downloaded module).

import-module $path\RES.WorkspaceManager.Tracing.psm1

Command usage:

Enable-RESTracing

Enables tracing and saves the trace file to c:\restrace.log

Enable-RESTracing -logfile c:\temp\trace.log

Enables tracing but overwrites the default log location of c:\restrace.log to c:\temp\trace.log

Disable-RESTracing

Exactly what it says on the tin.

Download:

You can download this new module from here:

Powershell Script to add all applications to a RES Workspace Container.

September 20, 2011 Leave a comment

As Part of a recent Proof of concept, I needed to move all of my applications from one workspace to another. With 50 + applications in just the proof of concept environment, the idea of opening each and modifying them individually did not excite me.

Upon starting my investigation, I found an interesting article by the PepperCrew’s @IngmarVerheij where he exported all building blocks, then used a find and replace command to add the workspace to the application, then added all building blocks back in again.

This approach worked great for his implementation, but I wanted to further automate my process while giving me the ability to amend a workspace without removing any currently configured workspaces.

My search continued to the following article on the RESGURU Blog, Where the RESGURU has kindly documented the usage of Powertech to automate (Certain) commands in the powerfuse / Workspace manager world. Sadly as they document, exporting from the database is not currently supported, but there was a glimmer of hope, they do support importing building blocks… result!

So the first task is to create your workspace and add one application to it, in my case I used notepad:

Next step is to export all applications to building blocks, this can be done easily by simply right clicking start icon and choosing building blocks > create…

Choose the directory you wish to work from (I Chose c:\temp) and click ok, I’ll later refer to this directory as your “scratch directory”.

Step three is to find the GUID of the workspace you wish to add all your applications to. Of the building blocks you’ve exported, find the application you added to the workspace. The workspaceGUID can be found as below, take a copy of this value for later:

Now that you have all the building blocks and the guid, the fun can begin!

Below you will find the automated script to add a workspace to each xml file, then load them back into workspace manager using the powertech.exe command line interface. Below is a quick screen shot of how it looks:

Although I’ve written this for Applications, this could just as easily work for printers, user registry, anything so long as you ammend the XML path correctly. If you do have a requirement for other components or building blocks, drop me a commend and I’ll see what I can do.

Two Values will need to amended for this script to work in your environment, I’ve highlighted them bold in the script

  • The workspace GUID
  • the scratch directory
$WorkspaceGUID="{D3DC6EFF-BA8C-4A8A-A6DC-C5039DCC9F46}"
$scratchdirectory="c:\temp\*.xml"

foreach ($process in (gwmi win32_process | where {$_.name -eq "pwrtech.exe"})){
    $owner = ($process.getowner()).user
    if ($owner -eq "$env:username") {
        Write-warning "pwrtech.exe is currently running in your session and can cause issues, close it now, I'll wait 20 seconds."
        start-sleep 20
    }#end if
}#end for

$blocks = get-childitem $scratchdirectory
foreach ($block in $blocks) {
 $i++
 Write-Progress -activity "Adding Workspace to Applications and importing the building blocks:" -status "Currently working on: $($Block.name)  ($i of $($blocks.length))" -PercentComplete (($i / $blocks.length) * 100)

   [xml]$XMLBlock = get-content $block.fullname

    if (!($XMLBlock.respowerfuse.buildingblock.application.workspacecontrol)){
        #did not find a reference to Workspace Control,
        #write-host "Adding Workspacecontrol and Workspace element to $block"
        $workspacecontrolelement = $XMLBlock.CreateElement("workspacecontrol")

        #create individual workspace entry
        $WorkspaceElement = $XMLBlock.CreateElement("workspace")
        $WorkspaceElement.psbase.innertext=$WorkspaceGUID

        #append both elements
        $workspacecontrolelement.appendchild($WorkspaceElement) | out-null

        #append elements to xml
        $XMLBlock.respowerfuse.buildingblock.application.appendchild($workspacecontrolelement)  | out-null

        #saving XML file:
        $XMLBlock.save($block.fullname)

        #committing to database
        start-process "C:\Program Files (x86)\RES Software\Workspace Manager\pwrtech.exe" -wait -argumentlist "/add /overwrite ""$($block.fullname)"""
    }#end IF
    Else{
        #Found a reference of workspace control, checking if our building block already contains the workspace we wish to add:
        if ($XMLBlock.respowerfuse.buildingblock.application.workspacecontrol.workspace -notcontains $WorkspaceGUID){
            #create a new workspace element to add to a current workspace control element
            #write-host "appending workspace in $block"
            $WorkspaceElement = $XMLBlock.CreateElement("workspace")
            $WorkspaceElement.psbase.innertext=$WorkspaceGUID
            $XMLBlock.respowerfuse.buildingblock.application.workspacecontrol.appendchild($WorkspaceElement) | out-null
            #saving XML file:
            $XMLBlock.save($block.fullname)

            #committing to database
            start-process "C:\Program Files (x86)\RES Software\Workspace Manager\pwrtech.exe" -wait -argumentlist "/add /overwrite ""$($block.fullname)"""        
         }#end If
        Else {
            Write-warning "$block contains this workspace container already, skipping."
        }#end else
    }#end Else

}#end for
Follow

Get every new post delivered to your Inbox.

Join 2,587 other followers