Using intune to create application desktop shortcuts
I’m trying to use intune to push an application shortcut to the public desktop. I created an lnk file and saved it to a shared network drive. I then wrote a powershell script to copy that file to a folder on the c drive of the pc and then form that folder to the public desktop. Here is the script
——————————————————————————————————————
#Create directory to hold icon file and copy file there
New-Item -Path “c:” -Name “scut” -ItemType “directory” -Force
Copy-Item “S:ShortcutsPS1 FilesFortinet IconFortiClientVPN.lnk” -Destination “c:scutFortiClientVPN.lnk”
$TargetFile = “c:scutFortiClientVPN.lnk”
$ShortcutFile = “$env:PublicDesktopFortiClientVPN.lnk”
$WScriptShell = New-Object -ComObject WScript.Shell
$Shortcut = $WScriptShell.CreateShortcut($ShortcutFile)
$Shortcut.TargetPath = $TargetFile
$Shortcut.Save()
————————————————————————————————————
I wrapped the script with intunewinapp utility and created a win32 app with the file. I use this as my install command. (forti2.ps1 is my original powershell file)
————————————————————————————————————–
powershell.exe -ExecutionPolicy Bypass -file forti2.ps1
—————————————————————————————————————
My detection rule is just a custom rule that looks for the file on the desktop. When the app runs I get
“The application was not detected after installation completed successfully (0x87D1041C)” error. Any ideas what I’m missing?
I’m trying to use intune to push an application shortcut to the public desktop. I created an lnk file and saved it to a shared network drive. I then wrote a powershell script to copy that file to a folder on the c drive of the pc and then form that folder to the public desktop. Here is the script ——————————————————————————————————————#Create directory to hold icon file and copy file thereNew-Item -Path “c:” -Name “scut” -ItemType “directory” -ForceCopy-Item “S:ShortcutsPS1 FilesFortinet IconFortiClientVPN.lnk” -Destination “c:scutFortiClientVPN.lnk”$TargetFile = “c:scutFortiClientVPN.lnk”$ShortcutFile = “$env:PublicDesktopFortiClientVPN.lnk”$WScriptShell = New-Object -ComObject WScript.Shell$Shortcut = $WScriptShell.CreateShortcut($ShortcutFile)$Shortcut.TargetPath = $TargetFile$Shortcut.Save() ————————————————————————————————————I wrapped the script with intunewinapp utility and created a win32 app with the file. I use this as my install command. (forti2.ps1 is my original powershell file)————————————————————————————————————–powershell.exe -ExecutionPolicy Bypass -file forti2.ps1 ————————————————————————————————————— My detection rule is just a custom rule that looks for the file on the desktop. When the app runs I get “The application was not detected after installation completed successfully (0x87D1041C)” error. Any ideas what I’m missing? Read More