Jan 15 2024 07:16 AM - edited Jan 15 2024 07:16 AM
I'm installing a desktop shortcut to all my endpoints. I'm installing it as a win32 app with this script.
#Create directory to hold icon file and copy file there
New-Item -Path "c:\" -Name "scut" -ItemType "directory" -Force
Copy-Item "S:\Shortcuts\UKGi.ico" -Destination "c:\scut\UKGi.ico"
#Shortcut creation and specify settings
$Shell = New-Object -ComObject ("WScript.Shell")
$ShortCut = $Shell.CreateShortcut("C:\users\public\desktop\UKG Time.lnk")
$ShortCut.TargetPath="---------------------------------------------- "
#$Shortcut.Arguments="---------------------------------------------- "
$ShortCut.IconLocation = "c:\scut\UKGi.ico";
$ShortCut.Description = "UKG Time";
$ShortCut.Save()
I already have a s: drive mapped to all my endpoints and I'm creating a folder on the c: drive of the destination pcs. I'm copying the ico file from the mapped drive to the c: drive then installing the shortcut. The desktop shortcut is created just fine. I just don't get the custom icon. The install behavior is via system. I went into the app and added the custom icon jpg as the logo of the app itself. Still no luck with the custom icon. Any suggestions?
Jan 15 2024 07:44 AM
Jan 15 2024 10:15 AM - edited Jan 15 2024 10:19 AM
You should have all the files in your .Intunewin package. Copy-Item "S:\Shortcuts\UKGi.ico" -Destination "c:\scut\UKGi.ico" should be Copy-Item ".\UKGi.ico" -Destination "c:\scut\UKGi.ico" if the files are all in one folder from which you create the .intunewin package. Run this with the System installation behavior when configuring the settings in Intune and uploading the package.
The system account doesn't have the mapping in its environment, so it doesn't work the way it's configured right now.
Please click Mark as Best Response & Like if my post helped you to solve your issue.
This will help others to find the correct solution easily. It also closes the item.
If one of the posts was helpful in other ways, please consider giving it a Like.
Jan 15 2024 01:58 PM
Jan 15 2024 01:59 PM
Jan 17 2024 04:25 AM
@Harm_Veenstra I put the ico in the same folder that’s accessible on the share, rebuilt the Intunewin package, and completely removed the app from intune and set it up again. I’m still not getting the custom icon. The shortcut installs on the public desktop just fine. It just doesn’t have the icon.
Jan 17 2024 06:05 AM
Jan 17 2024 06:21 AM
The install script.
#Create directory to hold icon file and copy file there
New-Item -Path "c:\" -Name "scut" -ItemType "directory" -Force
Copy-Item ".\UKGi.ico" -Destination "c:\scut\UKGi.ico
#Shortcut creation and specify settings
$Shell = New-Object -ComObject ("WScript.Shell")
$ShortCut = $Shell.CreateShortcut("C:\users\public\desktop\UKG Time.lnk")
$ShortCut.TargetPath="https://poarchbandcreeks-sso.prd.mykronos.com"
#$Shortcut.Arguments="https://poarchbandcreeks-sso.prd.mykronos.com"
$ShortCut.IconLocation = "c:\scut\UKGi.ico";
$ShortCut.Description = "UKG Time";
$ShortCut.Save()
Inside the folder.
Jan 17 2024 06:38 AM
SolutionJan 17 2024 07:05 AM
Jan 17 2024 06:38 AM
Solution