Skip to main content

App Deployments

Most app deployments that UEM have made for OAL have followed this template for both Intune and MECM. All created applications are stored in the \\auth.tamu.edu\TAMU\ConfigMGR\SourceContent\SoftwareDistribution\OAL\Applications folder. The templetes are store in the _Templates folder.

Folder Structure

Most, if not all apps, follow a basic folder structure of Vender > Product > Version. The version folder will contain all the files necessary for the install. This helps when a new version releases by making a new version folder to test new deployments without messing with the existing Production deployment.

Example: Dell Command Update v5.4.0

Dell 
- Dell Command Update
- 5.4.0
- DellCommandUpdateInstaller.exe
- Detection.ps1
- Install.ps1
- Uninstall.ps1

Detection

For both MECM and Intune, the detection script requires a STDOUT and an EXITCODE of 0 for a successfull install. This detection searches the registry for the MSI/PSChildName of the application. Most of the time new application versions change the MSI, so the $MSI variable must be set to the new value. You can diverge away from this template; this is not necessarily the only way to deploy apps.

Template

<#
.SYNOPSIS

.DESCRIPTION

.NOTES
Author:
Modified:
Date:
#>
$AppName = ""
$MSI = ""

$Apps = Get-ItemProperty "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*","HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*"
$App = $Apps | Where-Object { $_.PSChildName -eq $MSI }

if (-not ($App)) { exit 0 }

Write-Host "$AppName detected"
exit 0

If you notice in the template that there is a negated if statement if (-not ($App)) { exit 0 }, this is mainly to avoid doing a full if-else for neatness. At the end, if the app is detected it will write the a output and exit 0 so that MECM and Intune report correctly.

This detection script is just a registry check which alone can be done natively in MECM, but this allows for multiple items or items that MECM can't account for to be checked. A good example is the Recast Agent Deployment.

Example: Recast Agent Deployment

This detection is checking 4 things.

  • Is the Recast Management Server's self-signed certificate installed?
  • Do the Registry Keys ServerUri and AgentGatewayServerUri contain the correct values?
  • Does the Recast Agent's database exist and was it created after 11/24/2025 4:00 PM (Enrollement check)
  • Is the Recast Agent installed?
<#
.SYNOPSIS
Detection for Recast Agent v5.11.2511.1804
.DESCRIPTION

.NOTES
Author: Neil Feagan
Modified:
Date: 11/24/2025
#>
$AppName = "Recast Agent"
$MSI = "{452FF887-5674-4668-9734-CA094C3045D8}"
$ServerUri = "https://MECM-1P-RCST-W1.auth.tamu.edu:443"
$AgentGatewayServerUri = "https://MECM-1P-RCST-W1.auth.tamu.edu"
$ReEnrollDateTime = (Get-Date -Year 2025 -Month 11 -Day 24 -Hour 16 -Minute 00 -Second 00) # 11/24/2025 4:00 PM
$Apps = Get-ItemProperty "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*","HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*"

$Cert = Get-ChildItem -Path Cert:LocalMachine\Root | Where-Object {$_.Thumbprint -eq "82FE31A80B4F9DB80594BE593E7D9F4C3E26A0DF"}
$Reg = Get-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Recast Software\Recast Agent" -ErrorAction SilentlyContinue
$SQLDatabase = Get-Item -Path "$Env:ProgramData\Recast Software\Recast Agent\RecastAgent.sqlite" -ErrorAction SilentlyContinue
$App = $Apps | Where-Object { $_.PSChildName -eq $MSI }

if (-not ($App -and $Cert -and $Reg.ServerUri -eq $ServerUri -and $Reg.AgentGatewayServerUri -like "$AgentGatewayServerUri*" -and $SQLDatabase.CreationTime -gt $ReEnrollDateTime)) { exit 0 }

Write-Host "$AppName detected"
exit 0

Install & Uninstall

Both install and uninstall scripts are blank because each application is different in its needs. It does contain the command that need to be copied into the Install Command when adding it to Intune and/or MECM.

Templates

Install

<#
.SYNOPSIS

.DESCRIPTION
powershell.exe -executionpolicy bypass -file Install.ps1
.NOTES
Author:
Modified:
Date:
#>

Uninstall

<#
.SYNOPSIS

.DESCRIPTION
powershell.exe -executionpolicy bypass -file Uninstall.ps1
.NOTES
Author:
Modified:
Date:
#>