Using Microsoft Intune to perform Windows feature updates works well. In the last year, reporting, and additional status information have been added, which has added a great deal of control. However, in many scenarios, we need to fix that one application or uninstall a new built-in app that Security wants removed. The scenarios are endless.

Enablement packages were introduced in Windows 10 1903, which made the move from 1903 to 1909 smooth, just a couple of minutes of downtime during upgrade. Windows 11 will be a full in-place upgrade, which brings back the downtime, even if many improvements have been made since we did the first Windows 10 in-place upgrades. Windows 11 upgrading could be the moment when we need to do more, as there are more changes than Windows 10–Windows 10 servicing.

Which options do we have, then? Well, either we can use Setupconfig.ini, or we can use the custom scripts that are triggered at different steps of the in-place upgrade.

How can we do this with Intune? Well, we can create a Win32 app, which contains, for example, Setupconfig.ini and the scripts we want to run and deploy before we do an in-place upgrade. Then we can control the upgrade behavior independently of how Windows is being upgraded if it's an in-place upgrade and not done using the enablement package.

Setupconfig.ini

Setupconfig.ini is a file in which we can add command line options to Windows Setup. A complete list can be found here.

By creating a SetupConfig.ini file in %systemdrive%\Users\Default\AppData\Local\Microsoft\Windows\WSUS\Setupconfig.ini, the Windows 10 in-place upgrade will use that file independently of how the in-place upgrade was started, whether by MEMCM, ISO file, Intune, Windows Update, and so on.

Setupconfig.ini location

Setupconfig.ini location

Here is a sample of the Setupconfig.ini file I use when doing advanced servicing using Intune.

Sample Setupconfig.ini_

Sample Setupconfig.ini_

DynamicUpdate is important in some scenarios. It's a really great feature, but in some cases, we might not want it to run.

The sample includes both the PostOOBE and the PostRollback commands, which means we have control of the process. We can install/script whatever we want after OOBE, and we can do the same if a rollback occurs.

Advanced servicing

I put together a little package that can be used, which uses PowerShell to copy my Setupconfig.ini file to the correct location along with my folder, called AdvancedIPU, to C:\Windows\AdvancedIPU.

AdvancedIPU folder

AdvancedIPU folder

The script looks like this:

if (!(Test-Path "$($env:SystemDrive)\Users\Default\AppData\Local\Microsoft\Windows\WSUS")) {
    New-Item -Path "$($env:SystemDrive)\Users\Default\AppData\Local\Microsoft\Windows\WSUS" -ItemType Directory -Force -EA SilentlyContinue | Out-Null
}

Copy-Item -Path "$($PSScriptRoot)\Setupconfig.ini" "$($env:SystemDrive)\Users\Default\AppData\Local\Microsoft\Windows\WSUS\Setupconfig.ini" -Force | Out-Null
Copy-Item -Path "$($PSScriptRoot)\AdvancedIPU" "$env:windir" -Recurse -Force | Out-Null 

The AdvancedIPU folder is retained after the upgrade, so if we need to upgrade Windows again, it can be used again. If we don't want it to run during the next OS upgrade, we can delete it after the upgrade is complete.

In my AdvancedIPU folder, I have the following files:

AdvancedIPU contents

AdvancedIPU contents

In my SetupComplete folder, I have my script and a great little tool called RunSilent.exe, which I use for more than just this solution. Runsilent.exe reads commands from Runsilent.ini and executes them. It suppresses the PowerShell blue screen and logs the output to C:\Windows\temp\Runsilent.log. Runsilent.exe can be downloaded from here.

Of course, it works just as well running the commands directly in SetupComplete.cmd.

Here is a sample of my runsilent.ini file:

Sample Runsilent.ini_

Sample Runsilent.ini_

Creating the AdvancedIPU Win32 app

Before we can deploy the AdvancedIPU, we need to create our IntuneWin file using IntuneWinAppUtil.exe. I have added an extra text file called AdvancedIPU.txt, which I use as the setup file; otherwise, it will be called Setup, which is hardly useful.

IntuneWinAppUtil example

IntuneWinAppUtil example

I use the following installation command for my Win32 app:

Program installation

Program installation

I kept it simple and used Setupconfig.ini as a detection method for the application in Intune.

Detection method

Detection method

Deploy advanced servicing

Then we deploy the AdvancedIPU package to our clients using Intune. When it is installed, we are ready to test out the AdvancedIPU.

Advanced IPU was installed successfully

Advanced IPU was installed successfully

Then we can use Feature Update or update rings; it doesn't matter which we use.

After the feature update has been completed, we can simply check the Runsilent.log file located in C:\Windows\Temp. There, we can easily see from the output that the Runsilent commands have completed successfully.

Subscribe to 4sysops newsletter!

Sample Runsilent.log_

Sample Runsilent.log_

Summary

Using a Setupconfig.ini file is a great solution when we need to do something extra during a Windows OS upgrade. It works both if you are upgrading from one version of Windows 10 to another or if you are upgrading to Windows 11. Extremely useful!

avatar
0 Comments

Leave a reply

Your email address will not be published.

*

© 4sysops 2006 - 2023

CONTACT US

Please ask IT administration questions in the forums. Any other messages are welcome.

Sending

Log in with your credentials

or    

Forgot your details?

Create Account