top of page
Search

(180) Microsoft Intune - Company Portal Shortcut

  • Writer: Mr B SOE way
    Mr B SOE way
  • 7 hours ago
  • 1 min read

A few months ago before I went on annual leave, a customer wanted to deploy Company Portal as a shortctut on the desktop for end users.


The easiest way I could figure out looks like this:

ree

Install.ps1 will do the following:


# Specify the display name for the shortcut
$shortcutName = "Company Portal"

# Specify the URL for the icon
md "C:\ProgramData\Devicie\CompanyPortalShortCut"
copy .\CompanyPortalIcon.ico "C:\ProgramData\Devicie\CompanyPortalShortCut\CompanyPortalIcon.ico"

# Specify the local path to save the icon
$localIconPath = "C:\ProgramData\Devicie\CompanyPortalShortCut\CompanyPortalIcon.ico"

# Create a WScript Shell object
$wshShell = New-Object -ComObject WScript.Shell

# Create a shortcut object
$shortcut = $wshShell.CreateShortcut("C:\Users\Public\Desktop\$shortcutName.lnk")

# Set the target path for the shortcut
$shortcut.TargetPath = "shell:AppsFolder\Microsoft.CompanyPortal_8wekyb3d8bbwe!App"

# Set the icon location
$shortcut.IconLocation = "$localIconPath,0"

# Save the shortcut
$shortcut.Save()

Detect.ps1 will check if that shortcut is present

if (test-path "C:\Users\Public\Desktop\Company Portal.lnk"){"Installed"} 

Under Program,

Install command lines should be:

%windir%\sysnative\windowspowershell\v1.0\powershell.exe -executionPolicy bypass -windowstyle hidden -file "./Install.ps1"

Install behaviour: System Context

ree

Once packaged up and uploaded to Intune, it will show up like this on the desktop

ree

 
 
 

Comments


bottom of page