Powershell Module for Citrix WEM – Part 1 – Application actions


Part 2 was posted, featuring GPO Import and more:

Part 3 was posted, featuring Environmental Settings, Microsoft USV Settings, and more:

I am not going to explain here how Citrix Windows Environment Manager (WEM) works, what it is, etc. There are many blog posts or other websites doing a much better job at that than I ever could.

If you ever worked with WEM, and specifically, adding a new environment, you know how adding all the actions could get a little tedious.
It got tedious for me after adding the second Application action.

Normally you open the Citrix WEM console, go to Actions – Applications, and click Add to add a new application shortcut. This will show an Application template in which you have to fill in or select the properties for the shortcut:

That’s nice and all if you want to add a few shortcuts as Actions for this environment. But imagine you have an environment with a lot of applications.
Furthermore, if you want to have the icons for all your applications for instance, you can only use this method to add shortcuts if the WEM console is installed on the machine where all the applications are deployed.
The same goes for all the other types of Actions, but those are out of scope for this blog post.

Here’s where my Powershell module kicks in. This post focusses on creating an XML file for Application Actions in WEM.

The module contains a function called New-VUEMApplicationsXML. The parameters and usage is explained with Get-Help New-VUEMApplicationsXML -Detailed:
You can use this function anywhere, no dependencies on WEM whatsoever, as long as the Citrix.WEM module is present.

This means you can take your image, deploy it to a VM, including all applications, copy the Powershell module to the VM, import the module, and with a single command import all start menu shortcuts into an WEM compatible XML file.

Example of importing a Windows 10 Start Menu with lots of shortcuts:

NOTE: This video was created based on the initial release of the module. In that release you created the xml file by piping the output to a file using Out-File. This is no longer needed as the function now does that for you.

The video shows the command in action without using any parameters. In this case the command will process all .lnk files in “C:\ProgramData\Microsoft\Windows\Start Menu” and “\Microsoft\Windows\Start Menu”.

If you specify the -Path parameter, and the parameter points to a path, the command will process .lnk files in that path. If the parameter points to a file, the command will process that file only.

You can turn off recursive processing by specifying -Recurse $false. This only works if the Path parameter is specified, and points to a path.

If you want to process other file types besides .lnk files, you must specify the -FileTypes parameter, comma-seperating the filetypes you want to process. Only valid if the Path parameter is specified, and points to a path.

By default all Application actions will be generated to be Enabled. If you want all actions to be disabled, use the -Disable switch.

The script defaults to the current folder for output and uses the mandatory VUEMApplications.xml filename. You can override this behaviour by specifying the -OutputPath and -OutputFileName parameters.

You can download the latest version of the module on GitHub: https://github.com/msfreaks/Citrix.WEM


Until next time,


Arjan Mensch

25+ years experience in Microsoft powered environments. Enjoy automating stuff using powershell. In my free time (hah! as if there is any) I used to hunt achievements and gamerscore on anything Xbox Live enabled (Windows Mobile, Windows 8, Windows 10, Xbox 360 and Xbox One). Recently I picked up my Lego addiction again.

Tagged with: , ,
Posted in Citrix, Powershell
14 comments on “Powershell Module for Citrix WEM – Part 1 – Application actions
  1. This is truly great! Great work!

  2. Edwin van 't Oost says:

    Hi Arjan, Thank you for the tool.
    I would like to use it to migrate applications to WEM.
    Is this PowerShell Module also compatible with WEM 4.5?
    I did the Application export to the .xml file, but when I try to import the settings, the WEM console stays empty. No list of applications to be imported.I did the same steps discribed in the video. (Server 2016 / WEM 4.5)
    Kind regards,
    Edwin van ‘t Oost

  3. Edwin van 't Oost says:

    Hi Arjan,
    Thank you for the modified version. This one works perfect! Many Thanks.
    Kind regards,
    Edwin van ‘t Oost

  4. Marcus Niemann says:

    Hi Arjan, many thanks for your script.
    I have tried it with WEM 4.5 and had problems during the import of Application actions. After a little bit of testing it worked for me if I change the attribute Displayname in line 1065 to DisplayName (Old: ‘Displayname’ = $DisplayName New: ‘DisplayName’ = $DisplayName).
    I changed line 1099 too, but I have not tested the VUEMNetDrive function.
    Kind regards
    Marcus Niemann

  5. Nikos Zafeirakis says:

    Hi Arjan,
    I cannot import the Citrix.Wem.psm1: was not loaded because no valid module file was found in any module directory

    • Arjan Mensch says:

      Hi Nikos, you need to download the file and when you use import-module you need to supply the full path to the file on your machine. If unclear see get-help import-module.

  6. Nikos Zafeirakis says:

    Still, i get the same error.Usually i don’t have issues when importing modules.

  7. Sven Wiegmink says:

    Tested it with WEM1811, application path is empty after import.

  8. […] My good friend Arjan Mensch and I spent a huge amount of time a couple of years back building a powershell module that did this, and much much more. By we, I mean mostly him, I just provided the chaos policies and […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Blog Authors

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 446 other followers

Blog Stats
  • 3,603,316 hits
  • An error has occurred; the feed is probably down. Try again later.
  • An error has occurred; the feed is probably down. Try again later.
%d bloggers like this: