- Remote help for Intune and Microsoft Endpoint Manager - Tue, Jan 25 2022
- Windows 10/11 Azure AD/Intune Enterprise subscription is not valid - Mon, Nov 8 2021
- Upgrade from Windows 10 to Windows 11 with Setupconfig.ini and Intune - Wed, Sep 22 2021
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.
Here is a sample of the Setupconfig.ini file I use when doing advanced servicing using Intune.
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.
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:
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:
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.
I use the following installation command for my Win32 app:
I kept it simple and used Setupconfig.ini as a detection method for the application in Intune.
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.
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!
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!