Back to Posts

A Holiday Present for You: Quick Application Tracking Script

ControlUp’s Reporter tool is the standard tool for creating historical reports from the csv files that ControlUp exports. The next generation of historical reporting is coming in version 5.0 with ControlUp Insights and has already gotten rave reviews from our beta customers. Still, you may want to get specific information about a particular process that is not available from Reporter, and is not yet available via ControlUp Insights. So what can you do?

ControlUp’s support team to the rescue! We have written a short but effective PowerShell script for extracting relevant information from your ControlUp_Processes_*.csv files. Basically, this script will extract all of the lines relating to a specific app from the raw ControlUp Process exports and put them in a separate csv for further processing in Excel.

THE BASIC SYNTAX OF THE SCRIPT IS:

ProcessExport.ps1 [-App] <String> [-TargetDir] <String> [[-ReportDir] <String>] [-NoDupes] [-Log] [<CommonParameters>]

WHERE:

App <String>

This is the application name the script will extract information about. This parameter is required.

TargetDir <String>

The directory where the output csv, ProcessReport.csv, will be placed. This parameter is required.

ReportDir <String>

The directory where the ControlUp export csvs exist. By default this is C:\CUExports if it is not specified.

NoDupes [<SwitchParameter>]

Using this switch will cause the output csv (ProcessReport-unique.csv) to only have unique entries as defined by the combination of PID, Session ID, and Username.

Log [<SwitchParameter>]

Using this switch will create a detailed log file in the target directory.

So an example of running the script to create C:\temp\ProcessReport.csv to learn about unique usages of MS Word could be:

ProcessExport.ps1 -App winword.exe -TargetDir C:\temp -NoDupes –Log

And a snapshot of the script:

(Just as a usage note, because the script puts everything in RAM, the deduplication of entries in the output can cause PowerShell to use excessive amounts of memory which could slow down processing. But this only occurs if you are trying to process millions of lines of csv and you are looking for a process that has a very high hit rate, like csrss.exe (Windows’ Client/Server Runtime Subsystem service). The script should perform just fine for normal usage for processes that are not ubiquitous.)

One thing that makes our script perform so well is that we use native DotNet functions and objects to process the files rather than more traditional PowerShell cmdlets. This cuts the processing time and memory requirements by a very large amount and allows us to get your output in the minimum time necessary.

Want to learn more about ControlUp Insights? Get in touch and we’ll be happy to show you a demo.

Leave a Reply

Your email address will not be published. Required fields are marked *