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/
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?
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.
- Sep 08, 2021Hi, could you check if the "system" account has permissions on the public desktop folder? As the other account was also missing? You could try it out yourself by downloading psexec and launch psexec -i -s powershell.exe en trying to execute the ps1 again line by line... (the intune mgt extension powershell scripts are run in system context if you don't configured to run under the user context)
- AB21805Sep 08, 2021Bronze Contributor
So now the icon works manually after deploying the script which I got from your blog which allows permission to the public desktop! but I am still unable to deploy the destopicon / link from intune !
The script is the same i use manually (which you have posted in this thread) :
$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"
The script settings on intune: (assignment group are devices)
Is ther anyway to find out why this is failing:
Or is there another way around this maybe deploying the actual .ps1 to a folder using intune and then get a script to run it? is this possible as running it from the device actually works!
- AB21805Sep 08, 2021Bronze ContributorThank you! Ill take a look and let you know how I get on!
- 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/ - AB21805Sep 08, 2021Bronze Contributor
I have changed the interactive permission to modify and it worked by running manually on the device which didnt work with this script before! Can I add something in the script to enable this
- AB21805Sep 08, 2021Bronze Contributor
Do you mean this? If something needs changing can we do this via intune too for this to work?
- Sep 08, 2021Hi can you post the "outcome" of the ntfs permission tab from the public desktop folder? it looks like some permissions are missing
- AB21805Sep 08, 2021Bronze Contributor
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" - AB21805Sep 08, 2021Bronze Contributor
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?
- Sep 08, 2021Hi,
Can you first open powershell and copy paste the script in it line by line... hopefully you can get the error