dsccommunity / SqlServerDsc

This module contains DSC resources for deployment and configuration of Microsoft SQL Server.
MIT License
360 stars 227 forks source link

SqlSetup: SQMReporting not disabled #1785

Open goforebroke opened 2 years ago

goforebroke commented 2 years ago

Problem description

Want to disable SQMReporting as part of install.

SQL Server is installed, but SQM never gets disabled.

I have tried both

SQMReporting = $false and SQMReporting = 'False'

Verbose logs

No errors clean install.

/SQMREPORTING="False"

https://docs.microsoft.com/en-us/sql/database-engine/install-windows/install-sql-server-from-the-command-prompt?view=sql-server-ver16

The docs say the value should be 0 or 1. Does the SQLServerDSC module translate $false or 'False' to 0?

VERBOSE: Perform operation 'Invoke CimMethod' with following parameters, ''methodName' =
SendConfigurationApply,'className' = MSFT_DSCLocalConfigurationManager,'namespaceName' =
root/Microsoft/Windows/DesiredStateConfiguration'.
VERBOSE: An LCM method call arrived from computer SERVERNAME with user sid

VERBOSE: [SERVERNAME]: LCM:  [ Start  Set      ]
VERBOSE: [SERVERNAME]: LCM:  [ Start  Resource ]  [[WindowsFeature]NetFramework]
VERBOSE: [SERVERNAME]: LCM:  [ Start  Test     ]  [[WindowsFeature]NetFramework]
VERBOSE: [SERVERNAME]:                            [[WindowsFeature]NetFramework] The operation 'Get-WindowsFea
started: NET-Framework-45-Core
VERBOSE: [SERVERNAME]:                            [[WindowsFeature]NetFramework] The operation 'Get-WindowsFea
succeeded: NET-Framework-45-Core
VERBOSE: [SERVERNAME]: LCM:  [ End    Test     ]  [[WindowsFeature]NetFramework]  in 0.6520 seconds.
VERBOSE: [SERVERNAME]: LCM:  [ Skip   Set      ]  [[WindowsFeature]NetFramework]
VERBOSE: [SERVERNAME]: LCM:  [ End    Resource ]  [[WindowsFeature]NetFramework]
VERBOSE: [SERVERNAME]: LCM:  [ Start  Resource ]  [[Group]SQLPerformVolumeMaintenanceTasks]
VERBOSE: [SERVERNAME]: LCM:  [ Start  Test     ]  [[Group]SQLPerformVolumeMaintenanceTasks]
VERBOSE: [SERVERNAME]:                            [[Group]SQLPerformVolumeMaintenanceTasks] A group with the n
SQLPerformVolumeMaintTasks exists.
VERBOSE: [SERVERNAME]:                            [[Group]SQLPerformVolumeMaintenanceTasks] Resolving MYDOMAIN
SQLPVM domain.
VERBOSE: [SERVERNAME]:                            [[Group]SQLPerformVolumeMaintenanceTasks] Resolving MYDOMAIN\
with domain trust.
VERBOSE: [SERVERNAME]: LCM:  [ End    Test     ]  [[Group]SQLPerformVolumeMaintenanceTasks]  in 1.3220 seconds
VERBOSE: [SERVERNAME]: LCM:  [ Skip   Set      ]  [[Group]SQLPerformVolumeMaintenanceTasks]
VERBOSE: [SERVERNAME]: LCM:  [ End    Resource ]  [[Group]SQLPerformVolumeMaintenanceTasks]
VERBOSE: [SERVERNAME]: LCM:  [ Start  Resource ]  [[Group]SQLAdjustMemoryQuotasForAProcess]
VERBOSE: [SERVERNAME]: LCM:  [ Start  Test     ]  [[Group]SQLAdjustMemoryQuotasForAProcess]
VERBOSE: [SERVERNAME]:                            [[Group]SQLAdjustMemoryQuotasForAProcess] A group with the n
SQLAdjustMemoryQuotasForAProcess exists.
VERBOSE: [SERVERNAME]: LCM:  [ End    Test     ]  [[Group]SQLAdjustMemoryQuotasForAProcess]  in 0.2020 seconds
VERBOSE: [SERVERNAME]: LCM:  [ Skip   Set      ]  [[Group]SQLAdjustMemoryQuotasForAProcess]
VERBOSE: [SERVERNAME]: LCM:  [ End    Resource ]  [[Group]SQLAdjustMemoryQuotasForAProcess]
VERBOSE: [SERVERNAME]: LCM:  [ Start  Resource ]  [[Group]SQLGenerateSecurityAudits]
VERBOSE: [SERVERNAME]: LCM:  [ Start  Test     ]  [[Group]SQLGenerateSecurityAudits]
VERBOSE: [SERVERNAME]:                            [[Group]SQLGenerateSecurityAudits] A group with the name
SQLGenerateSecurityAudits exists.
VERBOSE: [SERVERNAME]: LCM:  [ End    Test     ]  [[Group]SQLGenerateSecurityAudits]  in 0.1340 seconds.
VERBOSE: [SERVERNAME]: LCM:  [ Skip   Set      ]  [[Group]SQLGenerateSecurityAudits]
VERBOSE: [SERVERNAME]: LCM:  [ End    Resource ]  [[Group]SQLGenerateSecurityAudits]
VERBOSE: [SERVERNAME]: LCM:  [ Start  Resource ]  [[Group]SQLLockPagesInMemoryGroup]
VERBOSE: [SERVERNAME]: LCM:  [ Start  Test     ]  [[Group]SQLLockPagesInMemoryGroup]
VERBOSE: [SERVERNAME]:                            [[Group]SQLLockPagesInMemoryGroup] A group with the name
SQLLockPagesInMemoryGroup exists.
VERBOSE: [SERVERNAME]: LCM:  [ End    Test     ]  [[Group]SQLLockPagesInMemoryGroup]  in 0.1590 seconds.
VERBOSE: [SERVERNAME]: LCM:  [ Skip   Set      ]  [[Group]SQLLockPagesInMemoryGroup]
VERBOSE: [SERVERNAME]: LCM:  [ End    Resource ]  [[Group]SQLLockPagesInMemoryGroup]
VERBOSE: [SERVERNAME]: LCM:  [ Start  Resource ]  [[Group]SQLReplaceAProcessLevelToken]
VERBOSE: [SERVERNAME]: LCM:  [ Start  Test     ]  [[Group]SQLReplaceAProcessLevelToken]
VERBOSE: [SERVERNAME]:                            [[Group]SQLReplaceAProcessLevelToken] A group with the name
SQLReplaceAProcessLevelToken exists.
VERBOSE: [SERVERNAME]: LCM:  [ End    Test     ]  [[Group]SQLReplaceAProcessLevelToken]  in 0.1970 seconds.
VERBOSE: [SERVERNAME]: LCM:  [ Skip   Set      ]  [[Group]SQLReplaceAProcessLevelToken]
VERBOSE: [SERVERNAME]: LCM:  [ End    Resource ]  [[Group]SQLReplaceAProcessLevelToken]
VERBOSE: [SERVERNAME]: LCM:  [ Start  Resource ]  [[SqlSetup]DB]
VERBOSE: [SERVERNAME]: LCM:  [ Start  Test     ]  [[SqlSetup]DB]
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Using path
'\\SHARENAME\PATH\SQL2019\Standard\setup.exe'.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Detecting Database Engine feature.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Database Engine feature not detected.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Detecting Full-text feature.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Full-text feature not detected.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Detecting Reporting Services feature.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Reporting Services feature not detected.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Detecting Analysis Services feature.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Analysis Services feature not detected.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Detecting Integration Services feature.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Integration Services feature detected.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Perform operation 'Query CimInstances' with
following parameters, ''queryExpression' = SELECT * FROM Win32_Service WHERE Name = 'MsDtsServer150','queryDialec
WQL,'namespaceName' = root\cimv2'.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Operation 'Query CimInstances' complete.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Detecting Documentation Components feature
(HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\150\ConfigurationState).
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Documentation Components feature not detected
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Detecting Client Connectivity Tools feature
(HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\150\Tools\Setup\Client_Components_Full).
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Client Connectivity Tools feature detected.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Detecting Client Connectivity Backwards
Compatibility Tools feature (HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\150\Tools\Setup\Client_Components_Full
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Client Connectivity Backwards Compatibility T
feature detected.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Detecting Client Tools SDK feature
(HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\150\Tools\Setup\Client_Components_Full).
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Client Tools SDK feature not detected.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Detecting Master Data Services (MDS) feature
(HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\150\ConfigurationState).
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] 'Master Data Services (MDS) feature not detec
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Features found: IS,CONN,BC
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Unable to find feature 'SQLENGINE' among the
installed features: 'IS,CONN,BC'.
VERBOSE: [SERVERNAME]: LCM:  [ End    Test     ]  [[SqlSetup]DB]  in 1.8230 seconds.
VERBOSE: [SERVERNAME]: LCM:  [ Start  Set      ]  [[SqlSetup]DB]
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Using path
'\\SHARENAME\PATH\SQL2019\Standard\setup.exe'.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Detecting Database Engine feature.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Database Engine feature not detected.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Detecting Full-text feature.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Full-text feature not detected.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Detecting Reporting Services feature.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Reporting Services feature not detected.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Detecting Analysis Services feature.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Analysis Services feature not detected.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Detecting Integration Services feature.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Integration Services feature detected.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Perform operation 'Query CimInstances' with
following parameters, ''queryExpression' = SELECT * FROM Win32_Service WHERE Name = 'MsDtsServer150','queryDialec
WQL,'namespaceName' = root\cimv2'.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Operation 'Query CimInstances' complete.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Detecting Documentation Components feature
(HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\150\ConfigurationState).
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Documentation Components feature not detected
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Detecting Client Connectivity Tools feature
(HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\150\Tools\Setup\Client_Components_Full).
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Client Connectivity Tools feature detected.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Detecting Client Connectivity Backwards
Compatibility Tools feature (HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\150\Tools\Setup\Client_Components_Full
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Client Connectivity Backwards Compatibility T
feature detected.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Detecting Client Tools SDK feature
(HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\150\Tools\Setup\Client_Components_Full).
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Client Tools SDK feature not detected.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Detecting Master Data Services (MDS) feature
(HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\150\ConfigurationState).
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] 'Master Data Services (MDS) feature not detec
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Robocopy is copying media from source
'\\SHARENAME\PATH\SQL2019\Standard'.' to destination
'C:\Users\username\AppData\Local\Temp\Standard'.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Robocopy is using unbuffered I/O.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Robocopy is started with the following argume
'\\SHARENAME\PATH\SQL2019\Standard' "C:\Users\username\AppData\Local\Temp\Standard" /e /purg
/njh /njs /ndl /nc /ns /nfl
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Robocopy reported that all files already pres
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Using path
'C:\Users\username\AppData\Local\Temp\Standard\setup.exe'.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Adding user 'MYDOMAIN\username' from the para
'PsDscRunAsCredential' as the first system administrator account for SQL Server.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Starting setup using arguments: /ACTION="Inst
/INSTANCEDIR="E:\Program Files\Microsoft SQL Server" /SQLUSERDBDIR="I:\MSSQL\MSSQL15.SB2\MSSQL\Data"
/AGTSVCSTARTUPTYPE="Automatic" /QUIET="True" /SECURITYMODE="SQL" /INSTALLSHAREDWOWDIR="E:\Program Files (x86)\Mic
SQL Server" /IACCEPTSQLSERVERLICENSETERMS="True" /SQLTEMPDBLOGDIR="H:\MSSQL\MSSQL15.SB2\MSSQL\Data"
/INSTANCENAME="SB2" /SQLBACKUPDIR="F:\MSSQL\MSSQL15.SB2\MSSQL\Backup"
/UPDATESOURCE=\\SHARENAME\PATH\SQL2019\Updates\APPROVED /SQMREPORTING="False"
/SQLUSERDBLOGDIR="J:\MSSQL\MSSQL15.SB2\MSSQL\Data" /SQLSYSADMINACCOUNTS="MYDOMAIN\ADMIN1" "MYDOMAIN\ADMIN2
"MYDOMAIN\ADMIN3" "MYDOMAIN\ADMIN4" /SQLTEMPDBDIR="G:\MSSQL\MSSQL15.SB2\MSSQL\Data"
/SQLCOLLATION="SQL_Latin1_General_CP1_CI_AS" /FEATURES=SQLENGINE /INSTALLSQLDATADIR="F:\MSSQL"
/INSTALLSHAREDDIR="E:\Program Files\Microsoft SQL Server" /UPDATEENABLED="True" /BROWSERSVCSTARTUPTYPE="Automatic
/SAPWD="********"
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Started the process with id 4884 using the pa
'C:\Users\username\AppData\Local\Temp\Standard\setup.exe', and with a timeout value of 7200 seconds.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Setup exited with code '0'. Setup finished
successfully.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Rebooting target node.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Using path
'\\SHARENAME\shares\PATH\SQL2019\Standard\setup.exe'.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Detecting Database Engine feature.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Database Engine feature detected.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Perform operation 'Query CimInstances' with
following parameters, ''queryExpression' = SELECT * FROM Win32_Service WHERE Name = 'MSSQL$SB2','queryDialect' =
WQL,'namespaceName' = root\cimv2'.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Operation 'Query CimInstances' complete.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Perform operation 'Query CimInstances' with
following parameters, ''queryExpression' = SELECT * FROM Win32_Service WHERE Name = 'SQLAgent$SB2','queryDialect'
WQL,'namespaceName' = root\cimv2'.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Operation 'Query CimInstances' complete.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Detecting replication feature
(HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL15.SB2\ConfigurationState).
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Replication feature not detected.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Detecting Data Quality Client feature
(HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\150\ConfigurationState).
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Data Quality Client feature not detected.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Detecting Data Services Client feature
(HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\150\DQ\*).
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Data Quality Services feature not detected.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Preferred module SqlServer found.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Importing PowerShell module 'SqlServer' with
version '21.1.18221' from path 'C:\Program Files\WindowsPowerShell\Modules\SqlServer\21.1.18221\SqlServer.psd1'.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Connected to SQL instance 'SERVERNAME\SB2'
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Clustered instance not detected.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Detecting Full-text feature.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Full-text feature not detected.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Detecting Reporting Services feature.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Reporting Services feature not detected.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Detecting Analysis Services feature.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Analysis Services feature not detected.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Detecting Integration Services feature.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Integration Services feature detected.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Perform operation 'Query CimInstances' with
following parameters, ''queryExpression' = SELECT * FROM Win32_Service WHERE Name = 'MsDtsServer150','queryDialec
WQL,'namespaceName' = root\cimv2'.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Operation 'Query CimInstances' complete.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Detecting Documentation Components feature
(HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\150\ConfigurationState).
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Documentation Components feature not detected
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Detecting Client Connectivity Tools feature
(HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\150\Tools\Setup\Client_Components_Full).
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Client Connectivity Tools feature detected.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Detecting Client Connectivity Backwards
Compatibility Tools feature (HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\150\Tools\Setup\Client_Components_Full
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Client Connectivity Backwards Compatibility T
feature detected.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Detecting Client Tools SDK feature
(HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\150\Tools\Setup\Client_Components_Full).
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Client Tools SDK feature not detected.
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Detecting Master Data Services (MDS) feature
(HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\150\ConfigurationState).
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] 'Master Data Services (MDS) feature not detec
VERBOSE: [SERVERNAME]:                            [[SqlSetup]DB] Features found: SQLENGINE,IS,CONN,BC
VERBOSE: [SERVERNAME]: LCM:  [ End    Set      ]  [[SqlSetup]DB]  in 126.3240 seconds.
VERBOSE: [SERVERNAME]: LCM:  [ End    Resource ]  [[SqlSetup]DB]
VERBOSE: [SERVERNAME]:                            [] A reboot is required to progress further. Please reboot t
system.
WARNING: [SERVERNAME]:                            [] A reboot is required to progress further. Please reboot t
system.
VERBOSE: [SERVERNAME]: LCM:  [ End    Set      ]
VERBOSE: [SERVERNAME]: LCM:  [ End    Set      ]    in  131.6660 seconds.
VERBOSE: Operation 'Invoke CimMethod' complete.
VERBOSE: Time taken for configuration job to complete is 131.734 seconds

DSC configuration

snippet of configuration is shown below

 elseif($Features.ToUpper().Contains("SQLENGINE")){

                SqlSetup DB {
                    InstanceName = $sqlConfig.Instance
                    SourcePath = $sqlConfig.SourcePath
                    SourceCredential = $Credential
                    Features = $sqlConfig.Features
                    InstallSharedDir = $sqlConfig.InstallSharedDir 
                    InstallSharedWOWDir= $sqlConfig.InstallSharedWOWDir
                    InstanceDir= $sqlConfig.InstanceDir
                    SQLCollation=$sqlConfig.SQLCollation
                    SQLSysAdminAccounts=$sqlConfig.AdminAccounts.admin1,$sqlConfig.AdminAccounts.admin2,$sqlConfig.AdminAccounts.admin3
                    InstallSQLDataDir=$sqlConfig.InstallSQLDataDir
                    SQLUserDBDir=$sqlConfig.SQLUserDBDir
                    SQLUserDBLogDir=$sqlConfig.SQLUserDBLogDir
                    SQLTempDBDir = $sqlConfig.SQLTempDBDir
                    SQLTempDBLogDir = $sqlConfig.SQLTempDBLogDir
                    SQLBackupDir=$sqlConfig.SQLBackupDir
                    SecurityMode = 'SQL'
                    SAPwd = New-Object System.Management.Automation.PSCredential("sa", (ConvertTo-SecureString ([System.Web.Security.Membership]::GeneratePassword(16,2)) -AsPlainText -Force))
                    UpdateEnabled = $true
                    UpdateSource=$sqlConfig.UpdateSource
                    BrowserSvcStartupType = 'Automatic'
                    SQMReporting='False'
                    #SQLSvcAccount = $Node.SQLSvcAccount
                    #AgtSvcAccount = $Node.AgtSvcAccount
                    DependsOn='[WindowsFeature]NetFramework';
                    PsDscRunAsCredential = $Credential
                }

Suggested solution

N/A

SQL Server edition and version

SQL Server 2019

SQL Server PowerShell modules

Name      Version    Path
----      -------    ----
SqlServer 21.1.18221 C:\Program Files\WindowsPowerShell\Modules\SqlServer\21.1.18221\SqlServer.psd1
SQLPS     15.0       E:\Program Files (x86)\Microsoft SQL Server\150\Tools\PowerShell\Modules\SQLPS\SQLPS.psd1

Operating system

OsName               : Microsoft Windows Server 2022 Standard
OsOperatingSystemSKU : StandardServerEdition
OsArchitecture       : 64-bit
WindowsVersion       : 2009
WindowsBuildLabEx    : 20348.1.amd64fre.fe_release.210507-1500
OsLanguage           : en-US
OsMuiLanguages       : {en-US}

PowerShell version

Name                           Value
----                           -----
PSVersion                      5.1.20348.859
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.20348.859
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

SqlServerDsc version

Name         Version  Path
----         -------  ----
SqlServerDsc 12.0.0.0 C:\Program Files\WindowsPowerShell\Modules\SqlServerDsc\12.0.0.0\SqlServerDsc.psd1
johlju commented 2 years ago

Seems you found a bug. The verbose output says it adds the argument /SQMREPORTING="False" to the setup executable, but the docs says that in this case the value for the argument should be 0 (disabled) or 1 (enabled).

Happy to review a PR that fixes this.

johlju commented 2 years ago

For SQL Server 2019 (2017 or newer) see this article: https://docs.microsoft.com/en-US/sql/sql-server/usage-and-diagnostic-data-configuration-for-sql-server?view=sql-server-2017

The argument SQMREPORTING also only seems to work for older versions of SQL Server (even if the correct value is set) when looking at the docs.