Forum Discussion
Creating desktop shortcuts
- Sep 08, 2021I guess so.. you can take a look at this blog of mine... it describes how I gave everyone full control to the public desktop... you can use it to change the interactive permissions i guess
https://call4cloud.nl/2021/01/public-desktop-icons-and-adminless-the-far-side-of-intune/
Add-Content $path "IconIndex=0"
- Sep 07, 2021
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
And after syncing the device the shortcut popped up
- AB21805Sep 08, 2021Bronze Contributor
Hi
So after doing this script manually it fails:
$null = $WshShell = New-Object -comObject WScript.Shell$path = "C:\Users\Public\Desktop\youtube.url"$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:
The group I have assigned this script to are devices not users
Any idea why this isnt working for me?
Please help!
- Sep 08, 2021
Hi... the first script (my script :P) is working like expected... when I run it manually
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?