Posted in: All Posts, MEMCM/SCCM

Configure This: Create an application for Edge in MECM

I know Tyler promised I would have a Bitlocker post coming and it is! Promise. It’s just pretty involved and, in the interest of knocking out low hanging fruit, I figured I would get this post out of the way.

In my lab, I’m running MECM 2002 and the development team at Microsoft couldn’t have made it simpler to create an application to deploy Microsoft Edge. It’s all wizard driven and really just requires a few basic decisions to complete. Starting under Software Library, right click on Microsoft Edge Management and select Create Microsoft Edge Application.

You’ll then name your application and select a location for the source files. The handy thing about this wizard is it actually downloads the source files for Microsoft Edge for you.

At this point in the wizard you can select the channel you’d like to participate in, the version of Microsoft Edge you would like to download and whether or not you would like to participate in automatic updates. Available channels are Stable, Dev and Beta. From the standpoint of manageability, I have selected the stable channel, the latest version (at time of writing 84.0.522.40) and not to update, so as to maintain granular control over the update process.

The next screen will allow you to select whether or not you want to deploy the application now. For the sake of simplicity, I’ve selected no here. If you select Yes it will allow you to select the collection to deploy to.

Summary to confirm your settings.

Once you click next from summary, the installation bits for Microsoft Edge will be downloaded to the specified source location you selected at the beginning of the wizard. Navigating to the location will show you a folder with the version number and an x86 and x64 folder.

Looking in the folders you will see the MSI installer for Edge as well as a Powershell script called, Install-Edge.ps1. Looking at the content of the installer script, you will see there are some mandatory parameters that must be passed for the script to function. The great thing is the wizard fills these in automagically for you.

param
(
    [parameter(Mandatory=$true)]
    [ValidateNotNullOrEmpty()]
    [ValidatePattern('^[a-zA-Z0-9]+.[m|M][s|S][i|I]$')]
    [string]$MSIName,
        
    [parameter(Mandatory=$true)]
    [ValidateNotNullOrEmpty()]
    [ValidatePattern('^{[0-9A-Fa-f]{8}[-][0-9A-Fa-f]{4}[-][0-9A-Fa-f]{4}[-][0-9A-Fa-f]{4}[-][0-9A-Fa-f]{12}}$')]
    [string]$ChannelID,

    [parameter(Mandatory=$true)]
    [ValidateNotNullOrEmpty()]
    [string]$DoAutoUpdate
)

# See if autoupdate is false
if($DoAutoUpdate -eq $false)
{   
    # Registry value name is in the format "Update<{ChannelID}> where ChannelID is the GUID
    Set-Variable -Name "AutoUpdateValueName" -Value "Update$ChannelID" -Option Constant
    Set-Variable -Name "RegistryPath" -Value "HKLM:\SOFTWARE\Policies\Microsoft\EdgeUpdate" -Option Constant

    # Test if the registry key exists. If it doesn't, create it
    $EdgeUpdateRegKeyExists = Test-Path -Path $RegistryPath

    if (!$EdgeUpdateRegKeyExists)
    {
        New-Item -Path $RegistryPath
    }

    # See if the autoupdate value exists
    if (!(Get-ItemProperty -Path $RegistryPath -Name $AutoUpdateValueName -ErrorAction SilentlyContinue))
    {
        New-ItemProperty -Path $RegistryPath -Name $AutoUpdateValueName -Value 0 -PropertyType DWord
    }

   $AutoupdateValue = (Get-ItemProperty -Path $RegistryPath -Name $AutoUpdateValueName).$AutoUpdateValueName

   # If the value is not set to 0, auto update is not turned off, this is a failure
    if ($AutoupdateValue -ne 0)
    {
        Write-Host "Autoupdate value set incorrectly"
        return -1
    }
}
# Install the Edge MSI
return (Start-Process msiexec.exe -Wait -PassThru -ArgumentList "/i $MSIName /q").ExitCode
powershell -File ".\Install-Edge.ps1" -MSIName "MicrosoftEdgeEnterpriseX64.msi" -ChannelID "{56eb18f8-b008-4cbd-b6d2-8c97fe7e9062}" -DoAutoUpdate "False"

And that’s about it to create the application. Kudos to the development team for streamlining the process to create and deploy the application! Coming up next will be a post on creating an ADR (Automatic Deployment Rule) for Microsoft Edge updates. (As well as my upcoming Bitlocker post! It’s coming!)

Comment (1) on "Configure This: Create an application for Edge in MECM"

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.