Monday, March 9, 2020

Ivanti Workspace Control AppV application scanner







Ivanti Workspace Control AppV Application scanner







Project Manager - 8am: 
Can you get me a list of all AppV applications in Ivanti (still RES for some of us) Workspace Control?

You: 
Sure boss, no problem (of course how hard can it be) ...

Project Manager - 12pm: 
Did you already get me that list?

You: 
Eeeuuhm, it's taking a bit longer, there's no freaking possible way to filter or sort the applications that way..


Have you ever been in such a situation, and didn't have a zone or Workspace defined which you could use to filter out all AppV applications?

Well I have, and that called for some Powershelling.

To get the AppV applications I figured there were two possible ways to get the data:

1) Query the database and filter the results, translate the bin value,         nah to complicated
2) Export all applications to a single building block and query the        xml?

Option 2 seemed like the way to go, only downside is that exporting the applications can take a while but hey you already did this to backup your environment, didn't you?


Now let's go to the goodies....

Below is the script I created, it accepts a commandline parameter.

Example: IWCAppScanner.ps1 -appv5PackageMode full_global

This will result in a list of all AppV applications which have the publishing mode set to full global.
The other options can be found in the script.
To define the xml file location just change the $xmlPath variable.

#################################################################################
# Project   : Get all App-V applications with certain package mode from xml file
# Developer : Patrick van Grinsven
# Version   : 1.0   
# Published : 9-3-2020
#################################################################################

# Define command line parameter appv5PackageMode
# Values can be:
# minimal_global
# full_global
# minimal_user
# full_user
# none

param (

    [string] $appv5PackageMode

      )

$CommandLineArray = "minimal_global","full_global","minimal_user","full_user","none"

# This is the location where the xml file can be found
# Export the Applications to 1 xml file, NOT multiple !
$xmlPath='C:\temp\ExportAPPLICATION.XML'

# Load the xml file into an object
$xmlAppData=New-Object -TypeName XML
$xmlAppData.Load($xmlPath)

# Check if there's a valid commandline Argument passed
if ( $CommandLineArray -contains $appv5PackageMode)
    {
        $xmlAppData.respowerfuse.buildingblock.application.configuration | Where-Object { $_.appv5packagemode -contains $appv5PackageMode } | Select-Object -Property title,appv5packagemode,commandline
    }
    else
    {
        Write-Host 'ERROR - Illegal commandline argument...'
    }

2 comments:

  1. Nice and cool script! Can you make it in such a ways that you can choose which filter you would like to apply? For example when I need a list of Citrix Published Applications? or TS RemoteApps?

    ReplyDelete
  2. I am currently working on an application scanner tool, I will take this options into consideration.

    ReplyDelete