Advanced deployment of web links with Intune

Advanced deployment of web links with Intune

Intune supports a variety of app types app types, including web apps. Unfortunately, the settings you can configure when deploying a web link to Windows 10 devices with Intune are limited. Fortunately, PowerShell scripts can be also be used with Intune to deploy web links to these devices, which take away the limitations described in this post.

When deploying a web link to Windows 10 devices that is configured from the Client Apps > Apps pane in Intune, the web link is limited to:

  • Opening using the Default Browser;
  • Showing the Default Browser’s icon;
  • Adding the shortcut only to the Start Menu;

By using PowerShell scripts to deploy a web link, you can:

  • Specify which Browser should be used to open the web app;
  • Add a custom Icon to the web app’s shortcut;
  • Specify if the shortcut is added to the User’s desktop and/or Start Menu;

I have published three PowerShell scripts to the TechNet Gallery, which can be used to:

  1. Deploy a web link using the default browser;
  2. Deploy a web link using Edge as browser;
  3. Deploy a web link using Google Chrome as browser;

How to deploy a web link using the PowerShell script?

  1. Modify the parameter values to your needs;
  2. Upload the PowerShell script to Intune;
  3. Set Run this script using the logged on credentials to Yes in the PowerShell script settings.
  4. Assign the PowerShell script to one or more Azure Active Directory groups that contain the users whose devices receive the script;

 

21 thoughts on “Advanced deployment of web links with Intune

  1. Can you add multiple shortcuts in the same script or do you need one script per shortcut?

    Thanks again for this.

    1. Hi Michael,

      You can combine multiple shortcuts in a single script.

      I would separate this myself, so you can track the deployments individually and be able to target different groups of users and/or devices per shortcut.

  2. I am trying to inject links onto the start menu of a shared computer. The script works for me on computers that are logged in with a user but on our computers that are “Kiosk” and only ever have guest accounts logged in the links don’t show up. Is this possible?

    1. Hi Leifit,

      As there is no user that logs on to the device, you will have to modify the paths where the shortcut is created, so that they are stored in a system location instead of a user’s profile.

      You can replace:
      $Shortcut = $WScriptShell.CreateShortcut("$env:USERPROFILE\Desktop\$ShortcutName.lnk")
      with
      $Shortcut = $WScriptShell.CreateShortcut("$env:PUBLIC\Desktop\$ShortcutName.lnk")

      and

      $Shortcut = $WScriptShell.CreateShortcut("$env:APPDATA\Microsoft\Windows\Start Menu\Programs\$ShortcutName.lnk")
      with
      $Shortcut = $WScriptShell.CreateShortcut("$env:ALLUSERSPROFILE\Microsoft\Windows\Start Menu\Programs\$ShortcutName.lnk")

      Also, you will have run the script in SYSTEM context and assign the PowerShell script to devices instead of users for it to be deployed.

      Regards,

      John

  3. Hi,
    I tried to deploy the script with Intune, I received a “suceeded” status but I don’t see the shortcut on my laptop yet. Do I have anything else to do ?

    thank you

    1. Hi Alexandra,

      Are you sure you run the script using the logged on user credentials? If the script runs as system, it will also succeed, but it won’t save the shortcut to the currently logged in user’s profile.

      Regards,

      John

  4. Hi!

    Great articel! I have tried the script but it only creates a shortcut in the start menu. Not on the desktop? We use shared device mode in Intune. Any thoughts?

    Thanks!

  5. Hi,

    I tried follow your instructions to deploy the script with intune and I received a Succeeded, but the shortcut does not appear on the desktop or in the Start Menu. I have Run this script using the logged on credentials set to Yes per your instructions. Any ideas as to what I am doing wrong?

    1. Hi Svet,

      Maybe there are some configurations in place that are blocking the creations of shortcuts (in the right directory). I’m thinking maybe OneDrive Known Folder Move might be in place which could cause that. When I wrote this post I didn’t have that configured. You could try to use [Environment]::GetFolderPath(“Desktop”) instead of $env:USERPROFILE\Desktop or check out my reply to Leifit to deploy shortcuts in SYSTEM context instead of user.

      Regards,

      John

    1. Hi Thomas,

      This code block should help you create a shortcut with Internet Explorer

      $WScriptShell = New-Object -ComObject WScript.Shell

      if ($ShortcutOnDesktop) {
      $Shortcut = $WScriptShell.CreateShortcut("$env:USERPROFILE\Desktop\$ShortcutName.lnk")
      $ShortCut.TargetPath = "C:\Program Files (x86)\Internet Explorer\iexplore.exe"
      $Shortcut.Arguments = $ShortcutUrl
      $ShortCut.WorkingDirectory = "C:\Program Files (x86)\Internet Explorer"
      $Shortcut.Arguments = $ShortcutUrl
      if ($ShortcutIconLocation) {
      $Shortcut.IconLocation = $ShortcutIconLocation
      }
      $Shortcut.Save()
      }

      Regards,

      John

      1. Hi John,

        Thanks, that’s a great article. I’ve been using this script for the devices and it works perfectly (thanks again). However I also configured OneDrive KFM.
        Now when a users logs on to a new device the script is executed and seems to create a shortcut copy. How could I check in my script whether the shortcut already exists in the dekstop folder?

        Thank you!

Leave a Reply

Your email address will not be published. Required fields are marked *