In diesem Blog möchte ich erklären, wie du mit Hilfe von Intune eine Verknüpfung zu einer Website auf dem Desktop erstellen kannst. Das kannst du zum Beispiel nutzen, um das Öffnen der Intranet-Seite oder einer Webanwendung deines Unternehmens für die Benutzer schneller und einfacher zu machen.
Inhaltsverzeichnis
Alle Skripte, die ich in diesem Blog verwende, findest du in meinem Git-Repository: Create-DesktopShortcut
Die Desktop-Verknüpfung erstellen
Mit dem folgenden Skript kannst du eine Verknüpfungsdatei erstellen: Create-ShortcutFile.ps1
Bevor du dieses Skript ausführst, musst du es bearbeiten. Passe dafür die folgenden Variablen an:
#Name of the shortcut $shortcutName = "Intranet Shortcut" #Icon file best to use a website $icon = "https://jannikreinhard.com/files/website.ico" #Link of the webseite $websiteUrl = "https://jannikreinhard.com/" #OutputFolder $outputFolder = "C:temp"
Hinweis: Wenn du die Windows-Shell-Icons verwenden möchtest, kannst du das mit dem folgenden Pfad in der Icon-Variablen tun.
%SystemRoot%System32SHELL32.dll,27
Sobald du diese Variablen angepasst hast, kannst du die .lnk-Datei erstellen, indem du das Skript ausführst. Du findest diese Datei in dem Pfad, den du in der Variablen $outputFolder angegeben hast.

Die benötigten Skripte erstellen
Wir müssen 3 Skripte erstellen, um die Anwendung über Intune zu verteilen. Ein Installations-, ein Deinstallations- und ein Erkennungsskript ist erforderlich. Wo du die Skripte findest und wie du sie anpassen musst, erkläre ich jetzt.
Installationsskript
Um die Verknüpfung auf die Desktops aller Benutzer zu kopieren, müssen wir das PowerShell-Installationsskript erstellen. Dieses Skript findest du als PowerShell-Skript auf GitHub.
#Name of the shortcut $shortcutName = "Intranet Shortcut" $ScriptPath = [System.IO.Path]::GetDirectoryName($MyInvocation.MyCommand.Definition) Copy-Item -Path "$ScriptPath$shortcutName.lnk" -Destination "$Env:PublicDesktop"
Bearbeite dieses Skript und trage den Namen, den du für die Verknüpfung gewählt hast, in die Variable $shortcutName ein.
#Name of the shortcut $shortcutName = "Intranet Shortcut"
Deinstallationsskript
Nachdem dieses Skript erstellt ist, benötigen wir ein Deinstallationsskript. Auch dieses findest du in meinem Repository.
#Name of the shortcut $shortcutName = "Intranet Shortcut" Remove-Item -Path "$Env:PublicDesktop$shortcutName.lnk"
Auch hier muss die Variable $shortcutName angepasst werden.
#Name of the shortcut $shortcutName = "Intranet Shortcut"
Erkennungsskript
Hier findest du das Erkennungsskript: Get-DesktopShortcut.ps1
#Name of the shortcut
$shortcutName = "Intranet Shortcut"
if (Test-Path -Path "$Env:PublicDesktop$shortcutName.lnk"){
Write-Output "0"
}
Der Name der Verknüpfung muss auch hier eingetragen werden.
#Name of the shortcut $shortcutName = "Intranet Shortcut"
Die Intune-Anwendungsdatei erstellen
Wie man eine Intune-Anwendung (.intunewin-Datei) erstellt, habe ich am Beispiel von CMtrace ausführlich in Deploy a Win32 app with Intune (CMtrace) erklärt. Weitere Informationen findest du auch in den Microsoft Docs.
- Erstelle einen Ordner, in dem du die Verknüpfung sowie das Installations- und das Deinstallationsskript ablegen kannst.

- Öffne eine CMD als Administrator und führe den folgenden Befehl aus:
.IntuneWinAppUtil -c C:tempIntranetShortcut -s C:tempIntranetShortcutCreate-DesktopShortcut.ps1 -o C:temp

Die Win32-App in Intune erstellen
- Navigiere zu Apps -> Windows
- Klicke auf Hinzufügen
- Wähle Windows-App (Win32) als App-Typ

- Klicke auf App-Paketdatei auswählen
- Klicke auf Hochladen und wähle die .intunewin-Datei aus
- Klicke auf OK

- Gib der Anwendung einen Namen und passe die App-Informationen an.
- Klicke auf Weiter

- Gib Folgendes als Installations- und Deinstallationsbefehl ein
Installationsbefehl:
%windir%system32windowspowershellv1.0powershell.exe -executionpolicy bypass -windowstyle hidden -file "Create-DesktopShortcut.ps1"
Deinstallationsbefehl:
%windir%system32windowspowershellv1.0powershell.exe -executionpolicy bypass -windowstyle hidden -file "Delete-DesktopShortcut.ps1"
- Ändere das Neustartverhalten des Geräts auf Keine spezifische Aktion
- Klicke auf Weiter

- Wähle 32-Bit und 64-Bit als Betriebssystemarchitektur
- Wähle eine minimale Betriebssystemversion
Hinweise: Wenn du weitere Anforderungen festlegen möchtest, wie zum Beispiel minimalen freien Speicherplatz, kannst du das in diesem Schritt tun.
Es ist auch möglich, eine Datei, einen Registry-Wert oder ein Skript als Anforderung anzugeben.

- Wähle Benutzerdefiniertes Erkennungsskript verwenden als Regelformat
- Lade das Erkennungsskript hoch
- Klicke auf Weiter

- Den Schritt für Abhängigkeiten und Ersetzungen können wir überspringen, klicke auf Weiter.
- Füge eine Zuweisung hinzu. In meinem Beispiel habe ich alle Standardgeräte ausgewählt.
- Klicke auf Weiter > Erstellen

Jetzt wird die Verknüpfung an alle Computer in der Gruppe verteilt. Sobald das Anwendungspaket angekommen und auf den Computern installiert ist, solltest du die Verknüpfung auf dem Desktop finden.

Bleib gesund, Cheers
Jannik
[…] one of my last posts I explained how to create a desktop shortcut using a Win32 app. Now I want to show you a way how you can deploy a web shortcut for the Web Company Portal as an […]
step one is not creating the .ink file is there something missing in the script powershell doesn’t create a error.
The code in this blog is only an part of the script. The script is located here: https://github.com/JayRHa/Intune-Scripts/blob/main/Create-DesktopShortcut/Create-ShortcutFile.ps1
Why take the extra steps of making it an App? Why not just apply it as a Script Policy and skip all the Win32 App fluff?
Hey Matt, that is also a way depends only on how you want to structure your Intune tenant. I find it more appropriate that when I create a shortcut on the device that I also see this as an app.
Sounds good! I was just curious if I was missing a ‘best practice’. I thought about it over the weekend and I suppose the upside here is you’re presetting your removal of the icons, as I don’t believe the script policy would remove icons when the policy is no longer applied.
Yes that is completely correct. The script creates the shortcut but when this is no longer applied then the icon is not removed. Think for this an application is better. But Microsoft is currently working to support this ootb: https://docs.microsoft.com/en-us/mem/intune/fundamentals/in-development
I do not even know how I ended up here, but I thought this
post was good. I do not know who you are but definitely you are going to a famous blogger
if you aren’t already 😉 Cheers!
Woah! I’m really digging the template/theme of this site. It’s simple,
yet effective. A lot of times it’s challenging to
get that “perfect balance” between superb usability and appearance.
I must say you’ve done a amazing job with this. Also, the blog loads
very quick for me on Firefox. Exceptional Blog!
I’m truly enjoying the design and layout of your blog.
It’s a very easy on the eyes which makes it much more enjoyable for me to come here and visit more often. Did you
hire out a developer to create your theme? Great work!
server administration services (servermanagers.ng)
Excellent web ѕite. Plenty of helpful info
here. I am sending it to several buddies ans also sharing in deliciouѕ.
And naturally, thаnk you іn your effort!
My brother recommended I might like this blog. He was once entirely
right. This put up actually made my day. You can not imagine just how so much time I had spent for this information! Thanks!
microsoft azure management services
My friend TY! I was able to successfully test this!! I’ll be following you and stalking your blog for additional valuable information. :o)
When I run the Create-ShortcutFile.ps1 The shortcut file created doesn’t have the image like you show in this blog post. Is there something missing that make it? I verified my blobstorage link works etc.