Mobile Jon's headlines

HEADLINES:

HEADLINES:

Building a Windows 365 Custom Image

Mobile Jon's Blog

The Ultimate Freestyle Orchestrator Workflow: Dell Command Update

The Ultimate Freestyle Orchestrator Workflow: Dell Command Update

I have been writing about Freestyle Orchestrator workflows for a few years. First, I wrote about the introduction to FSO. Next, I went into some great real-world examples with Freestyle Orchestrator. (that honestly had a weak swing at DCU). My last article covered transitioning from products to scripts/workflows. Today’s article is going to be amazing! We cover the truly perfect workflow for Dell Command Update, which covers everything you could need! We will separate out each part of it, which culminates in a work-of-art!

The Sensor that Powers the Entire Workflow

For this workflow to be effective, we need to use a Windows sensor that acts as your check condition.

Luckily, I got your back! This code below will check if you have the regular application or UWP version of DCU and grab the version. Once that is done, it will echo it and write it to your sensor. It’s 100% magic:

# Check if Dell Command Update is installed as a Win32 program or Check if Dell Command Update is installed as a UWP package
$program = Get-WmiObject -Class Win32_Product | Where-Object { $_.Name -like "Dell Command | Update"}
if ($program) {
    $version = $program.Version
    echo $version
}
else {
$package = Get-AppxPackage | Where-Object {$_.Name -like "*DellCommandUpdate*"}    
}
if ($package) {
    $version = $package.Version
    echo $version
}

Removing Existing DCU Installations

One of the major issues with Dell Command Update outside of being a major pain in the ass, you cannot upgrade the standard install that comes on the machine as its a UWP. Yeah, I know FML.

So, it’s crucial before working all of your voodoo, that you look for any installations of DCU whether its a regular application or a UWP to burn them to the ground. This script is the way that you get there:

# Function to uninstall a UWP package
function Uninstall-UWPPackage {
    param(
        [string]$PackageFullName
    )
    $packageManager = [Windows.Management.Deployment.PackageManager]::new()
    $packageManager.RemovePackageAsync($PackageFullName) | Out-Null
}
# Get a list of installed programs
$programs = Get-WmiObject -Class Win32_Product | Where-Object {$_.Name -match "Dell Command (Update|\| Update)"}
$programCount = ($programs | Measure-Object).Count
if ($programCount -gt 0) {
    Write-Host "Dell Command Update found. Uninstalling..."
    foreach ($program in $programs) {
        $displayName = $program.Name
        $uninstallString = $program.IdentifyingNumber
        Write-Host "Uninstalling $displayName"
& msiexec.exe -x $uninstallString /qn
    }
    Write-Host "Uninstallation of Win32 programs complete."
}
else {
    Write-Host "Dell Command Update Win32 program is not installed."
}
# Get a list of installed UWP packages
$packages = Get-AppxPackage -AllUsers | Where-Object {$_.Name -like "*DellCommandUpdate*"}
if ($packages.Count -gt 0) {
    Write-Host "Dell Command Update UWP package found. Uninstalling..."
    foreach ($package in $packages) {
        $packageName = $package.Name
        $packageFullName = $package.PackageFullName
        Write-Host "Uninstalling $packageName"
        Uninstall-UWPPackage -PackageFullName $packageFullName
        Get-AppxProvisionedPackage -online | where {$_.DisplayName -eq "DellInc.DellCommandUpdate"} | Remove-AppxProvisionedPackage
    }
    Write-Host "Uninstallation of UWP packages complete."
}
else {
    Write-Host "Dell Command Update UWP package is not installed."
}

Building your Installer for Dell Command Update 4.9

The steps for the building the installer aren’t too crazy, but I’ll save you from Googling.

First, you download the installer from Dell Product Support. For 4.9 you can use this link.

Now, check the video below for the whole process as it only takes a minute.

Building the Dell Command Update Config File Deployment

As I’ve covered previously, you can’t upload files with Freestyle Orchestrator. A little bit of Mobile Jon code and you have created an awesome DCU settings XML file to help with configuring Dell Command Update to match your Windows Patching Profiles.

##Create the XML File##
New-Item C:\temp\settings.xml -ItemType File -Force
##Sets the XML File with Baseline Settings##
Set-Content C:\temp\settings.xml '<Configuration>
  <Group Name="Settings">
    <Property Name="AppCode">
      <Value>Universal</Value>
    </Property>
    <Property Name="InstallPath">
      <Value>C:\Program Files\Dell\CommandUpdate\</Value>
    </Property>
    <Group Name="General">
      <Property Name="UserConsent">
        <Value>false</Value>
      </Property>
      <Property Name="SuspendBitLocker">
        <Value>true</Value>
      </Property>
      <Group Name="CustomProxySettings">
        <Group Name="ProxyAuthentication" />
      </Group>
    </Group>
    <Group Name="Schedule">
      <Property Name="ScheduleMode">
        <Value>Weekly</Value>
      </Property>
      <Property Name="Time">
        <Value>2020-11-26T20:00:00</Value>
      </Property>
      <Property Name="DayOfWeek">
        <Value>Thursday</Value>
      </Property>
      <Property Name="AutomationMode">
        <Value>ScanDownloadApplyNotify</Value>
      </Property>
      <Property Name="RebootWait">
        <Value>OneHour</Value>
      </Property>
    </Group>
    <Group Name="UpdateFilter">
      <Group Name="RecommendedLevel" />
      <Group Name="UpdateType" />
      <Group Name="DeviceCategory" />
    </Group>
    <Group Name="AdvancedDriverRestore">
      <Property Name="IsAdvancedDriverRestoreEnabled">
        <Value>true</Value>
      </Property>
    </Group>
  </Group>
</Configuration>'

Configuring DCU via CLI

The last piece was a little interesting. Usually, I leverage Start-Process to execute stuff in PowerShell that would normally be done in CMD. This time, we had to leverage the & symbol to execute the dcu-cli.exe utility. Check the code below, but it’s nice and easy: (Strongly recommend the -outpugLog so you can audit stuff as needed:

& 'C:\Program Files (x86)\Dell\CommandUpdate\dcu-cli.exe' /configure -importSettings=C:\Temp\settings.xml -outputLog=C:\temp\DCULog.log
& 'C:\Program Files (x86)\Dell\CommandUpdate\dcu-cli.exe' /configure -autoSuspendBitLocker=enable -outputLog=C:\temp\DCULog.log
& 'C:\Program Files (x86)\Dell\CommandUpdate\dcu-cli.exe' /scan -outputLog=C:\temp\DCULog.log
& 'C:\Program Files (x86)\Dell\CommandUpdate\dcu-cli.exe' /applyUpdates -silent -reboot=enable -outputLog=C:\temp\DCULog.log

Bringing it all together with Freestyle Orchestrator

Now, you have all of the pieces for one of the prettiest use cases you will find for Freestyle Orchestrator. Within this one workflow:

  • Leveraging Sensors and Conditions
  • Executing a Cleanup Script
  • Installing new Apps
  • Configuring that App with scripts sequentially.

You can see it below:

I can imagine that the developers imagined creating something just like this with FSO. I hope you enjoy this, as it’s the latest iteration in my constant battle to make Dell Command Update a part of your automation family.

Facebook
Twitter
LinkedIn

Let me know what you think

Discover more from Mobile Jon's Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading

Scroll to Top