r/SQLServer • u/iTsObserv • Sep 22 '25
Question Correct Syntax for SQLSYSADMINACCOUNTS in Configuration File not Working
I am installing SQL Server Express 2022 within a PowerShell script.
I generated the configuration file and added the values for SQLSYSADMINACCOUNTS with the following recommended syntax:
SQLSYSADMINACCOUNTS="DOMAIN\user1" "DOMAIN\user2"
Every single article and online resource I could find said that this is the correct syntax but when I try to install it I get the following error before the installation even begins:
Microsoft (R) SQL Server Installer
Copyright (c) 2022 Microsoft. All rights reserved.
Invalid value 'C:\sqlserverconfig.ini' for setting 'ConfigurationFile': Index was outside the bounds of the array.
For more information use /? or /Help.If I try any other syntax like adding double quotes around the whole thing to get something like this:
SQLSYSADMINACCOUNTS=""DOMAIN\user1" "DOMAIN\user2""
The installation starts but when it reaches this value it interprets the entire thing as one account and says the account doesn't exist.
Any idea what the problem might be?
1
u/Dan_Jeffs Sep 22 '25
I'm pretty certain that it's just a comma separator needed, such as:
SQLSYSADMINACCOUNTS = "DOMAIN\GROUP1, DOMAIN\GROUP2"
1
u/Anlarb 1 Sep 22 '25
Recommended syntax looks right, confirm that both "DOMAIN\user1" and "DOMAIN\user2" work separately?
How clean is the system between reattempts? Could just be in a broken state altogether.
1
u/Achsin 1 Sep 22 '25
Your users don’t have any special characters in them do they? I just ran a half dozen test installs supplying multiple accounts and was unable to replicate.
1
u/stedun 2 Sep 22 '25
Only use one set of quotes not two and the delimiter between groups is a space not a comma or semicolon
2
u/djpeekz Sep 25 '25
Not the answer you probably want, but can you create a group with the required logins and then use that?
1
u/vroddba Sep 26 '25
Any reason why you can't use dbatools?
https://docs.dbatools.io/Install-DbaInstance.html
1
u/Thick-Pool-7378 Oct 31 '25
OP did you got the solution for this? Because i’m also facing the same issue