๐ฏ Scenario
You want to deploy desktop shortcuts via Intune. One for a classic installed app (PuTTY), and another for a Microsoft Store app (Calculator). Both should be handled via remediation scripts โ detection + remediation โ and work silently in the background.
๐งช Variant 1: Installed Program (PuTTY)
๐ Detection Script
# Check if the PuTTY shortcut exists on the public desktop
$ShortcutPath = "C:\Users\Public\Desktop\PuTTY.lnk"
if (Test-Path $ShortcutPath) {
exit 0 # Shortcut exists
} else {
exit 1 # Shortcut missing
}
๐ ๏ธ Remediation Script
# Create a desktop shortcut for PuTTY if missing
$TargetPath = "C:\Program Files\PuTTY\putty.exe"
$ShortcutPath = "C:\Users\Public\Desktop\PuTTY.lnk"
# Use WScript.Shell COM object to create the shortcut
$WshShell = New-Object -ComObject WScript.Shell
$Shortcut = $WshShell.CreateShortcut($ShortcutPath)
$Shortcut.TargetPath = $TargetPath
$Shortcut.Save()
โ Works great for any classic Win32 app with a known install path.
๐งช Variant 2: Microsoft Store App (Calculator)
๐ Detection Script
# Check if the Calculator shortcut exists
$ShortcutPath = "C:\Users\Public\Desktop\Calculator.lnk"
if (Test-Path $ShortcutPath) {
exit 0 # Shortcut exists
} else {
exit 1 # Shortcut missing
}
๐ ๏ธ Remediation Script
# Create a shortcut for the Microsoft Store Calculator app
$ShortcutPath = "C:\Users\Public\Desktop\Calculator.lnk"
$AppUserModelID = "Microsoft.WindowsCalculator_8wekyb3d8bbwe!App"
# Use WScript.Shell to create a shortcut that launches the UWP app
$WshShell = New-Object -ComObject WScript.Shell
$Shortcut = $WshShell.CreateShortcut($ShortcutPath)
$Shortcut.TargetPath = "explorer.exe"
$Shortcut.Arguments = "shell:AppsFolder\$AppUserModelID"
$Shortcut.Save()
๐ง Note: You can find the AppUserModelID using
Get-StartAppsin PowerShell.
๐งฉ Deployment via Intune
Use these as Proactive Remediation scripts in Endpoint Analytics.
- Detection: Checks if shortcut exists
- Remediation: Creates it if missing
- Scope: Assign to all devices or specific groups


Leave a Reply