Desktop Shortcuts via Intune Remediations

Desktop Shortcuts via Intune Remediations

๐ŸŽฏ 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-StartApps in 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

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