šø Because your budget said no to Log Analyticsā¦
š ļø But you still need to know what software your users are running!
š§ What Is This?
pXLabs.PoorAdminsSoftwareMeteringPackageĀ is a homemade PowerShell-based software metering solution built for Intune-managed environments that lost traditional metering when moving away from ConfigMgr. Itās lightweight, runs silently in the background, and logs application usage to a simple CSV.
Then, because weāre resourceful, we sync the results toĀ OneDrive,Ā SharePoint, or any other location your budget will tolerate.
This is for all the admins out there that areĀ āmissing our software metering data because we moved to Intuneā. Youāre not alone.
š What It Does
- šµļø Tracks process start and stop events (Event IDs 4688 & 4689)
- ā± Correlates runtime durations
- 𫼠Filters system and noise processes
- š Outputs usage logs to simple CSV files
- āļø Supports syncing results to OneDrive or other paths
- š” Works without Log Analytics, Endpoint Analytics, or any paid plans
- š§° Comes with a basic GUI to manage filter rules
š¦ Whatās Included
Install.ps1
: Installs the background scheduled task. Also supports uninstall viaĀ-Uninstall
Ā switch.Detect.ps1
: Used with Intune detection logicSoftwareMetering.ps1
: The main metering scriptProductFilterEditor.ps1
: A GUI editor for managing product/version filtersProductFilters.json
: Customize which apps to includeSyncUsageData.ps1
: Onedrive sync routine
š How It Works
- Scheduled TaskĀ runs the metering script hourly (hidden + silent).
- Script reads filters fromĀ
ProductFilters.json
Ā (which you can manage with a built-in GUI). - It queries Event Logs for new process starts and stops, pairs them up, calculates runtime, and writes to CSV.
- CSV is saved to a local path (e.g.,Ā
C:\ProgramData\pXLabs\SoftwareMetering\Logs\
). - From there? Sync to OneDrive, SharePoint, or grab it with a script. You do you.
š¼ GUI for Filter Management
Run:
.\ProductFilterEditor.ps1
This lets you add, remove, or edit software filters. Donāt worry, if you forget to typeĀ .exe
, weāll add it for you.
š Requirements
- Windows 10 or 11
- PowerShell 5.1+
- Admin rights to install the task
- Event Log auditing enabled for process creation and termination
Enabling Event Log Auditing
- OpenĀ Local Security PolicyĀ (
secpol.msc
) or use a GPO - Navigate toĀ Advanced Audit Policy Configuration > System Audit Policies > Detailed Tracking
- Enable:
- Audit Process Creation
- Audit Process Termination
- RunĀ
gpupdate /force
Ā or reboot to apply
š” Create Intune Win32 App
- Package the scripts:
- Place all files in a folder (e.g.,Ā
SoftwareMeteringPackage
) - Use theĀ Microsoft Win32 Content Prep ToolĀ to create anĀ
.intunewin
Ā file:
- Place all files in a folder (e.g.,Ā
IntuneWinAppUtil.exe -c <source_folder> -s Install.ps1 -o <output_folder>
- In Microsoft Intune:
- Go toĀ Apps > Windows > Add
- SelectĀ App type: Windows app (Win32)
- Upload theĀ
.intunewin
Ā file - Configure theĀ install command:
powershell.exe -ExecutionPolicy Bypass -File .\Install.ps1
- Set theĀ detection ruleĀ to useĀ
Detect.ps1
- (Optional) To support uninstall, configure:
powershell.exe -ExecutionPolicy Bypass -File .\Install.ps1 -Uninstall
- Assign to your devices or user group
š Output Format
CSV columns include:
- Timestamp
- ComputerName
- UserName
- Product
- Version
- Runtime (in minutes.seconds)
š¤ Why This Exists
Because you:
- Moved to Intune and lost metering
- Donāt have Microsoft E5 licenses
- Canāt enable Log Analytics or Kusto Queries
- Still need to know whoās running what (and for how long)
This tool fills that gap.
š Syncing Usage Logs to OneDrive
To help automate backing up your software metering logs, the install script sets up a scheduled task that runs theĀ SyncUsageData.ps1
Ā script every 4 hours.
What it does:
- Moves the current CSV log file (
UsageData.csv
) from the local logs folder (C:\ProgramData\pXLabs\SoftwareMetering\Logs
) into your OneDrive folder underĀSoftwareMetering\
- Renames the file on move to include the computer name and timestamp, e.g.,Ā
COMPUTERNAME-UsageData-2025-05-23_14-30.csv
- Automatically creates the OneDrive folder if it doesnāt exist
- Cleans up old files in OneDrive older than 30 days for space management
- If OneDrive is not detected (environment variable missing), the script exits silently without error
How it works:
- The script expects that OneDrive is installed and signed in for the user running the scheduled task
- Files are moved, not copied, so the localĀ
UsageData.csv
Ā resets for fresh logging - Old historical CSV files in OneDrive are pruned automatically
Customization:
TheĀ SyncUsageData.ps1
Ā script is provided as a working example to upload logs to OneDrive. You can modify it to sync or upload the CSV files toĀ any other path, network share, FTP server, cloud storage, or web API endpointĀ as your environment and requirements dictate. Just replace the file copy/move logic with your preferred method.
š” Optional Enhancements
- Parse results into Power BI
- Extend for specific departmental apps
- Auto-upload to Azure Blob or FTP
š License
This project is licensed under theĀ GNU General Public License v3.0. Feel free to modify, share, and contribute!
š Credits
Built by Jeff Pollock at pXLabs
šĀ https://pxlabs.info
šĀ GitHub ā @phriendx
Inspired by real-world IT budgets and for all the admins doing more with less.
Leave a Reply