SOLVED

Creating desktop shortcuts

%3CLINGO-SUB%20id%3D%22lingo-sub-2702797%22%20slang%3D%22en-US%22%3ECreating%20desktop%20shortcuts%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2702797%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20all%2C%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHow%20to%20I%20create%20desktop%20shortcuts%20via%20intune%3F%20Which%20go%20to%20specific%20sites%3F%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20ideas%3F%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2702797%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%20Friday%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EConditional%20Access%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EGraph%20API%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EIntune%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMobile%20Application%20Management%20(MAM)%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMobile%20Device%20Management%20(MDM)%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESoftware%20Management%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2703632%22%20slang%3D%22en-US%22%3ERe%3A%20Creating%20desktop%20shortcuts%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2703632%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F575283%22%20target%3D%22_blank%22%3E%40AB21805%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI've%20used%20Powershell%20scripts%20to%20do%20this%20in%20the%20past.%20I%20did%20a%20quick%20bing%20search%20and%20found%20someones%20notes%20on%20how%20to%20do%20this%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fwww.nickydewestelinck.be%2F2021%2F03%2F09%2Fhow-to-deploy-custom-url-shortcuts-with-microsoft-intune%2F%23%3A~%3Atext%3DGo%2520to%2520Devices%2520%253D%253E%2520Scripts.%2520Then%2520click%2520on%2CStep%25201.%2520Leave%2520the%2520extra%2520settings%2520as%2520default%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.nickydewestelinck.be%2F2021%2F03%2F09%2Fhow-to-deploy-custom-url-shortcuts-with-microsoft-intune%2F%23%3A~%3Atext%3DGo%2520to%2520Devices%2520%253D%253E%2520Scripts.%2520Then%2520click%2520on%2CStep%25201.%2520Leave%2520the%2520extra%2520settings%2520as%2520default%3C%2FA%3E.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2710144%22%20slang%3D%22en-US%22%3ERe%3A%20Creating%20desktop%20shortcuts%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2710144%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F575283%22%20target%3D%22_blank%22%3E%40AB21805%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20could%20take%20a%20look%20at%20what%20I%20did%20while%20creating%20a%20shortcut%20to%20a%20rdp%20file%20on%20a%20specific%20folder.%20You%20could%20skip%20the%20rdp%20part%20and%20just%20change%20the%26nbsp%3B%3CSPAN%3E%24targetpath%20%3D%20%22c%3A%5Cprogram%20files%20(x86)%5Crdp%5Cremoteapp.rdp%22%3C%2FSPAN%3E%3C%2FP%3E%3CP%3ETo%20the%20website%20you%20want%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcall4cloud.nl%2F2021%2F08%2Fremote-app-the-last-whish%2F%23option3%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3ERemote%20App%3A%20The%20Last%20Whish%20-%20Call4Cloud%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESoooo%20something%20like%20this%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%24null%20%3D%20%24WshShell%20%3D%20New-Object%20-comObject%20WScript.Shell%3CBR%20%2F%3E%24path%20%3D%20%22C%3A%5CUsers%5CPublic%5CDesktop%5Ccall4cloud.url%22%3CBR%20%2F%3E%24targetpath%20%3D%20%22%3CA%20href%3D%22https%3A%2F%2Fwww.call4cloud.nl%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.call4cloud.nl%3C%2FA%3E%22%3CBR%20%2F%3E%24iconlocation%20%3D%20%22C%3A%5CProgram%20Files%20(x86)%5CMicrosoft%5CEdge%5CApplication%5Cmsedge.exe%22%3CBR%20%2F%3E%24iconfile%20%3D%20%22IconFile%3D%22%20%2B%20%24iconlocation%3CBR%20%2F%3E%24Shortcut%20%3D%20%24WshShell.CreateShortcut(%24path)%3CBR%20%2F%3E%24Shortcut.TargetPath%20%3D%20%24targetpath%3CBR%20%2F%3E%24Shortcut.Save()%3C%2FP%3E%3CP%3EAdd-Content%20%24path%20%22HotKey%3D0%22%3CBR%20%2F%3EAdd-Content%20%24path%20%22%24iconfile%22%3CBR%20%2F%3EAdd-Content%20%24path%20%22IconIndex%3D0%22%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2722008%22%20slang%3D%22en-US%22%3ERe%3A%20Creating%20desktop%20shortcuts%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2722008%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F620702%22%20target%3D%22_blank%22%3E%40Rudy_Ooms%3C%2FA%3E%26nbsp%3BThank%20you!%20I%20will%20give%20this%20a%20try!%20and%20close%20once%20I%20give%20it%20ago!%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2722009%22%20slang%3D%22en-US%22%3ERe%3A%20Creating%20desktop%20shortcuts%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2722009%22%20slang%3D%22en-US%22%3EThank%20you!%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2724879%22%20slang%3D%22en-US%22%3ERe%3A%20Creating%20desktop%20shortcuts%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2724879%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F620702%22%20target%3D%22_blank%22%3E%40Rudy_Ooms%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHere%20is%20my%20script%20but%20it%20fails!%20any%20ideas%3F%20I%20have%20put%20the%20url%20in%20for%20a%20sharepoint%20location%20(Target%20path)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Screenshot%202021-09-06%20at%202.07.19%20PM.png%22%20style%3D%22width%3A%20486px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F308331i0940810BE2C09C33%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Screenshot%202021-09-06%20at%202.07.19%20PM.png%22%20alt%3D%22Screenshot%202021-09-06%20at%202.07.19%20PM.png%22%20%2F%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Screenshot%202021-09-06%20at%202.30.58%20PM.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F308332i71506D1455BAFA5B%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Screenshot%202021-09-06%20at%202.30.58%20PM.png%22%20alt%3D%22Screenshot%202021-09-06%20at%202.30.58%20PM.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2725423%22%20slang%3D%22en-US%22%3ERe%3A%20Creating%20desktop%20shortcuts%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2725423%22%20slang%3D%22en-US%22%3EIn%20the%20screenshot%20I%20am%20missing%20a%20%22%20%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2725427%22%20slang%3D%22en-US%22%3ERe%3A%20Creating%20desktop%20shortcuts%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2725427%22%20slang%3D%22en-US%22%3EAm%20I%20missing%20it%20at%20the%20end%3F%20Anywhere%20else%3F%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2725529%22%20slang%3D%22en-US%22%3ERe%3A%20Creating%20desktop%20shortcuts%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2725529%22%20slang%3D%22en-US%22%3ESo%20far%20As%20I%20see%20now..%20the%20last%20%22%20after%20iconindex%3D0%3CBR%20%2F%3E%3CBR%20%2F%3EAdd-Content%20%24path%20%22IconIndex%3D0%22%3C%2FLINGO-BODY%3E
Regular Contributor

Hi all, 

 

How to I create desktop shortcuts via intune? Which go to specific sites? 

 

Any ideas? 

24 Replies

@AB21805 

 

I've used Powershell scripts to do this in the past. I did a quick bing search and found someones notes on how to do this

 

https://www.nickydewestelinck.be/2021/03/09/how-to-deploy-custom-url-shortcuts-with-microsoft-intune....

 

 

 

@AB21805 

 

You could take a look at what I did while creating a shortcut to a rdp file on a specific folder. You could skip the rdp part and just change the $targetpath = "c:\program files (x86)\rdp\remoteapp.rdp"

To the website you want

 

Remote App: The Last Whish - Call4Cloud

 

Soooo something like this

 

$null = $WshShell = New-Object -comObject WScript.Shell
$path = "C:\Users\Public\Desktop\call4cloud.url"
$targetpath = "https://www.call4cloud.nl"
$iconlocation = "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe"
$iconfile = "IconFile=" + $iconlocation
$Shortcut = $WshShell.CreateShortcut($path)
$Shortcut.TargetPath = $targetpath
$Shortcut.Save()

Add-Content $path "HotKey=0"
Add-Content $path "$iconfile"
Add-Content $path "IconIndex=0"

@Rudy_Ooms Thank you! I will give this a try! and close once I give it ago! 

Thank you!

Hi @Rudy_Ooms 

 

Here is my script but it fails! any ideas? I have put the url in for a sharepoint location (Target path)

 

Screenshot 2021-09-06 at 2.07.19 PM.pngScreenshot 2021-09-06 at 2.30.58 PM.png

In the screenshot I am missing a " ?
Am I missing it at the end? Anywhere else?

So far As I see now.. the last " after iconindex=0

Add-Content $path "IconIndex=0"
Hi Rudy, still no luck and fails after adding the " where you said? ANy ideas?

Hi so after trying to run the script on the machine manually it works! But when I try deploying via intune it fails! How do I get it to succeed via intune? Any ideas?

Thats odd... I will try to see what happens at my side ... can you post a screenshot of the powershell script settings ? (user/system / 64 bits etc)

 

UPDATE: The first run in a sandbox worked like expected... waiting for it to be deployed to my test device/testtenant

 

UPDATE: Also copy paste my script above into a ps1, uploading it to intune

Rudy_Ooms_0-1631078818816.png

 

And after syncing the device the shortcut popped up

@Rudy_Ooms 

 

Hi 

 

So after doing this script manually it fails: 

 

$null = $WshShell = New-Object -comObject WScript.Shell
$path = "C:\Users\Public\Desktop\youtube.url"
$targetpath = "https://www.youtube.com"
$iconlocation = "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe"
$iconfile = "IconFile=" + $iconlocation
$Shortcut = $WshShell.CreateShortcut($path)
$Shortcut.TargetPath = $targetpath
$Shortcut.Save()

Add-Content $path "HotKey=0"
Add-Content $path "$iconfile"
Add-Content $path "IconIndex=0"
 
I have done this script and it works manually: 
 

#Create a wscript.shell object
$ComObj = New-Object -ComObject WScript.Shell

#Use the createshortcut method and assign to a variable
$ShortCut = $ComObj.CreateShortcut("$Env:USERPROFILE\desktop\youtube.url")

#Path to URL
$ShortCut.TargetPath = "http://www.youtube.com"

$ShortCut.Save()

 

But even though this works manually running it, it fails when deploying via intune!

 

I have using these settings: 

 

Screenshot 2021-09-08 at 9.56.55 AM.png

Screenshot 2021-09-08 at 10.04.03 AM.png

The group I have assigned this script to are devices not users

 

 

 

Any idea why this isnt working for me? 

 

Please help!

Hi... the first script (my script :P) is working like expected... when I run it manually 

 

Rudy_Ooms_0-1631094657517.png

 

But the second script i am noticing the variable :$Env:USERPROFILE\desktop\youtube.url

That means the script needs to be executed as the user... otherwise it will end up in the system desktop :) 

 

WHen using the first script manually ... do you receive an error ?

*do you have edge installed inside the program files folder?

*Can you check out the public desktop... are there any icons on it?  Maybe a gpo with conflicting settings?

Hi Rudy,

The error disappears to quickly to see what it says! haa All I manage to read is unable to..

I have however notices desktop in public folder is hidden? does this matter? although ther are icons in this folder.
Hi,

Can you first open powershell and copy paste the script in it line by line... hopefully you can get the error

Hi @Rudy_Ooms 

 

I have copied line for line seems like a permissions thing! I am logged in as a admin aswel! Do you know how I can fix this? 

 

 

Capture.PNG

@Rudy_Ooms 

 

Im wondering if its better to do it the Win32 way ? I just done understand this?

md "c:\program files (x86)\rdp"
copy .\rdp.ico "c:\program files (x86)\rdp\rdp.ico"
copy .\remoteapp.rdp "c:\program files (x86)\rdp\remoteapp.rdp"

Hi can you post the "outcome" of the ntfs permission tab from the public desktop folder? it looks like some permissions are missing

 

Do you mean this? If something needs changing can we do this via intune too for this to work? 

 

@Rudy_Ooms