Silent SQL Server 2022 Installation for Microsoft Intune – Windows 10,11

Published by

on

This post is relevant for Intune engineers who want to install SQL Server 2022 Dev Edition to Windows workstations silently.

We’ll use the full SQL Server installation media, capture the settings with the setup wizard, and turn those settings into a silent installer for Intune.

The important detail: saving ConfigurationFile.ini does not make the installation silent by itself. Remove the UIMODE entry from your deployment copy and run setup with /Q.

Before you begin: Developer edition is for development and testing, not production. Use a supported Windows version and include SQL Server updates in your deployment plan.

This walkthrough uses SQL Server 2022 Developer with the default MSSQLSERVER instance and Database Engine Services. Adjust the instance, features and administrator group for your environment.

First, configure SQL Server through the wizard and save the configuration file. Then test the silent install from an administrator command prompt before packaging the complete installation media for Intune. Intune will run the package in the System context.

Breathe.

Easy, right?

Let’s break it down below ↓

Part 1: Obtain the configuration file

How to Obtain the Configuration.ini file

Start on a Windows test computer where you have local administrator rights:

2. Mount the ISO, right-click setup.exe and choose Run as administrator. This opens SQL Server Installation Center. The screenshots below show the earlier web installer; with the ISO, go straight to Installation Center in step 3.

3. In the installation center click Installation, then SQL Server standalone installation

5. Allow Microsoft updates

6. Confirm setup rules pass. Resolve any issues that prevent moving forward.

7. Specify Developer Edition

8. Specify Azure Extension for SQL Server. I have disabled it since it was not necessary for my configuration.

9. Choose the Features you need. The minimum is Database Engine Services. You can also customize the installation directory here.

10. Choose the default instance ID or create a custom one.

11. Specify service accounts. I used the default settings and clicked next.

12. Choose Windows authentication and add the group that should administer SQL Server. The example uses BUILTIN\Administrators, which gives the computer’s local administrators SQL sysadmin access. Use your organization’s approved SQL administrator group if that access is too broad.

1. Click Add
2. Type administrators
3. Click Check Names
4. Click Next

13. At Ready to Install, open the folder shown for ConfigurationFile.ini and save a copy. Cancel the wizard without installing. Keep an unchanged original, then make a separate copy for deployment. In the deployment copy, remove the entire UIMODE line and leave QUIETSIMPLE=False. The /Q switch in the script below makes the installation fully silent, overriding QUIET=False in the generated file.

Review the instance name, features, paths and administrator group in your deployment copy. Avoid leaving values that only apply to the computer used to generate it. For more detail, see Microsoft’s configuration-file instructions.

If you selected Microsoft Update, the file will contain UpdateEnabled=True, USEMICROSOFTUPDATE=True and UpdateSource=MU. Those update checks need network access even though the SQL installation files are included in your package.

Part 2: Create the Intune package

Create the SQL Server 2022 Dev Edition Intune package

14. Create install.cmd beside the quiet ConfigurationFile.ini and a media folder containing all files copied from the mounted ISO. This wrapper uses paths relative to itself, waits for setup, and returns setup’s exit code. Only use /IACCEPTSQLSERVERLICENSETERMS after reviewing and accepting the applicable license terms.

@echo off
setlocal
pushd "%~dp0"
start /wait "" "%~dp0media\setup.exe" /Q /ACTION=Install /IACCEPTSQLSERVERLICENSETERMS /ConfigurationFile="%~dp0ConfigurationFile.ini"
set "rc=%ERRORLEVEL%"
popd
endlocal & exit /b %rc%

15. Create uninstall.cmd for the same instance and features. This example removes Database Engine Services from the default MSSQLSERVER instance. Test the uninstall separately before using it, and back up any databases you need to keep.

@echo off
setlocal
pushd "%~dp0"
start /wait "" "%~dp0media\setup.exe" /Q /ACTION=Uninstall /INSTANCENAME=MSSQLSERVER /FEATURES=SQLENGINE
set "rc=%ERRORLEVEL%"
popd
endlocal & exit /b %rc%

The uninstall wrapper expects the complete media folder beside it and targets MSSQLSERVER with SQLENGINE. Adjust those choices to match the actual deployment, then test before use.

16. Your source folder should contain install.cmd, uninstall.cmd, ConfigurationFile.ini and a media folder with the complete contents of the ISO. Keep the original configuration and the package output outside this folder. The older screenshot below shows the web-installer layout; use the full-media layout listed here instead.

Current layout: source\install.cmd, source\uninstall.cmd, source\ConfigurationFile.ini, and source\media\setup.exe with all of the ISO’s other files and subfolders.

Keep the output folder outside the source folder. In Intune, use install.cmd as the install command, uninstall.cmd as the uninstall command, and set Install behavior to System. Configure detection for your SQL instance and version, and review return codes and restart behavior before assigning the app.

Test before uploading: Open Command Prompt as administrator, change to your source folder, and run install.cmd. Setup should complete without opening the SQL installation wizard or asking for input. A command window may appear while the script runs; that is normal when testing it from your desktop. Once it finishes, run echo %ERRORLEVEL%, check that the SQL Server service is running, and connect with Windows authentication to run SELECT @@VERSION;. Start with a small Intune deployment group after your local test succeeds.

For setup options and Intune requirements, see SQL Server command-line setup and Intune Win32 app management.

Visit Create .intunewin Files Using IntuneWinAppUtil for a tutorial on how to use the IntuneWinAppUtil.exe to create Windows application packages that Intune can deploy to remote workstations.

Visit How to Upload a .intunewin file into Intune to learn how to get Intune to deploy .intunewin packages to remote workstations.

Continue learning

Follow these guides to package your installer, upload it to Intune, and organize your deployment groups.

← Browse all tech guidesBack to top ↑

Exploring between workdays?

Tea, Travel, and Tech also shares the travel side of life in IT. Browse Bangkok parks, food, and a study break, explore Singapore beyond Marina Bay, or visit the Travel Library for more personal stories.

Back to Tech Library

3 responses to “Silent SQL Server 2022 Installation for Microsoft Intune – Windows 10,11”

  1. Salman Avatar
    Salman

    what will be the install and uninstall cmd in intune?

    1. Ali Bakr Avatar

      Refer to steps 14,15, and 16.

      Step #14 and #15 contains the install and uninstall scripts. When you build the Win32 app, your package should contain a install.bat and uninstall.bat with those respective scripts (step #16).

      Then your app in Intune can use the names of those two .bat files for the install and uninstall commands.

  2. […] To see an example of how to build a Windows application for Intune deployment, click Silent SQL Server 2022 Installation for Microsoft Intune. […]

Leave a Reply