With the help of powershell script we have Created and Removed shortcuts on user Desktop through intune for the following applications.
Here are the steps how to deploy poweshell scripts through Intune:
Go to Azure management portal then go to Intune > Device Configuration > Scripts then add the scripts.
Adding of chrome Shortcut:
$SourceFileLocation = “${Env:ProgramFiles(x86)}\Google\Chrome\Application\chrome.exe”
$ShortcutLocation = “$env:USERPROFILE\Desktop\chrome.lnk”
$WScriptShell = New-Object -ComObject WScript.Shell
$Shortcut = $WScriptShell.CreateShortcut($ShortcutLocation)
$Shortcut.TargetPath = $SourceFileLocation
$Shortcut.Save()
Adding of Teams Shortcut:
$SourceFileLocation = “$env:USERPROFILE\AppData\Local\Microsoft\teams\current\teams.exe”
$ShortcutLocation = “$env:USERPROFILE\Desktop\teams.lnk”
$WScriptShell = New-Object -ComObject WScript.Shell
$Shortcut = $WScriptShell.CreateShortcut($ShortcutLocation)
$Shortcut.TargetPath = $SourceFileLocation
$Shortcut.Save()
Adding of Edge Shortcut:
$SourceFileLocation = “${Env:ProgramFiles(x86)}\Microsoft\Edge\Application\msedge.exe”
$ShortcutLocation = “$env:USERPROFILE\Desktop\edge.lnk”
$WScriptShell = New-Object -ComObject WScript.Shell
$Shortcut = $WScriptShell.CreateShortcut($ShortcutLocation)
$Shortcut.TargetPath = $SourceFileLocation
$Shortcut.Save()
Adding of Outlook shortcut :
$SourceFileLocation = “$($env:ProgramW6432)\Microsoft Office\root\Office16\OUTLOOK.EXE”
$ShortcutLocation = “$env:USERPROFILE\Desktop\outlooknew.lnk”
$WScriptShell = New-Object -ComObject WScript.Shell
$Shortcut = $WScriptShell.CreateShortcut($ShortcutLocation)
$Shortcut.TargetPath = $SourceFileLocation
$Shortcut.Save()
Removing of Shortcuts from users desktop:
- $Path = “$env:USERPROFILE\Desktop\shortcut Lenovo.lnk”
Remove-Item $Path
- $Path = “$env:USERPROFILE\Desktop\shortcut Windows Mail.lnk”
Remove-Item $Path
- $Path = “$env:USERPROFILE\Desktop\shortcut Windows Store.lnk”
Remove-Item $Path

