Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PowerShell DSC resource MSFT_xSQLServerSetup failed to execute Set-TargetResource functionality with error message: Test-TargetResource returned false after calling set. #88

Closed
bodunjo opened this issue Jul 29, 2016 · 22 comments
Labels
bug The issue is a bug.

Comments

@bodunjo
Copy link

bodunjo commented Jul 29, 2016

I'm trying to run SQL 2014c install using the xSQLserverSetup module with the following error messages:

Directory: C:\Temp\SqlServerSetup

Mode LastWriteTime Length Name


-a---- 29/07/2016 11:51 6248 LONSQL60A.mof
-a---- 29/07/2016 11:51 1122 LONSQL60A.meta.mof

PS C:\Program Files\WindowsPowerShell\Modules> Start-DscConfiguration -Path C:\Temp\SqlServerSetup\ -credential (Get-credential) -Verbose -Wait -Force
cmdlet Get-Credential at command pipeline position 1
Supply values for the following parameters:
VERBOSE: Perform operation 'Invoke CimMethod' with following parameters, ''methodName' = SendConfigurationApply,'className' = MSFT_DSCLocalConfigurationManager,'namespaceName' = root/Microsof
t/Windows/DesiredStateConfiguration'.
VERBOSE: An LCM method call arrived from computer CONTOSO.COM with user sid S-1-5-21-3798882980-2146746437-3985048140-44958.
VERBOSE: [CONTOSO.COM]: LCM: [ Start Set ]
VERBOSE: [CONTOSO.COM]: [DSCEngine] Importing the module C:\Windows\system32\WindowsPowerShell\v1.0\Modules\PSDesiredStateConfiguration\DscResources\MSFT_ScriptResour
ce\MSFT_ScriptResource.psm1 in force mode.
VERBOSE: [CONTOSO.COM]: [DSCEngine] Importing the module C:\Windows\system32\WindowsPowerShell\v1.0\Modules\PSDesiredStateConfiguration\DscResources\MSFT_RoleResource
\MSFT_RoleResource.psm1 in force mode.
VERBOSE: [CONTOSO.COM]: [DSCEngine] Importing the module C:\Program Files\WindowsPowerShell\Modules\xSQLServer\1.5.0.0\DscResources\MSFT_xSQLServerSetup\MSFT_xSQLServ
erSetup.psm1 in force mode.
VERBOSE: [CONTOSO.COM]: LCM: [ Start Resource ] [[Script]DisableFirewall]
VERBOSE: [CONTOSO.COM]: LCM: [ Start Test ] [[Script]DisableFirewall]
VERBOSE: [CONTOSO.COM]: [[Script]DisableFirewall] Importing the module MSFT_ScriptResource in force mode.
VERBOSE: [CONTOSO.COM]: LCM: [ End Test ] [[Script]DisableFirewall] in 1.2350 seconds.
VERBOSE: [CONTOSO.COM]: LCM: [ Skip Set ] [[Script]DisableFirewall]
VERBOSE: [CONTOSO.COM]: LCM: [ End Resource ] [[Script]DisableFirewall]
VERBOSE: [CONTOSO.COM]: LCM: [ Start Resource ] [[File]DSCResourceFolder]
VERBOSE: [CONTOSO.COM]: LCM: [ Start Test ] [[File]DSCResourceFolder]
VERBOSE: [CONTOSO.COM]: [[File]DSCResourceFolder] The network name cannot be found.
VERBOSE: [CONTOSO.COM]: [[File]DSCResourceFolder] The related file/directory is: \CONTOSO.COM\Modules.
VERBOSE: [CONTOSO.COM]: [[File]DSCResourceFolder] Building file list from cache.
VERBOSE: [CONTOSO.COM]: [[File]DSCResourceFolder] The destination object was found and no action is required.
VERBOSE: [CONTOSO.COM]: LCM: [ End Test ] [[File]DSCResourceFolder] in 7.6720 seconds.
VERBOSE: [CONTOSO.COM]: LCM: [ Skip Set ] [[File]DSCResourceFolder]
VERBOSE: [CONTOSO.COM]: LCM: [ End Resource ] [[File]DSCResourceFolder]
VERBOSE: [CONTOSO.COM]: LCM: [ Start Resource ] [[WindowsFeature]NTFranmeworkcore]
VERBOSE: [CONTOSO.COM]: LCM: [ Start Test ] [[WindowsFeature]NTFranmeworkcore]
VERBOSE: [CONTOSO.COM]: [[WindowsFeature]NTFranmeworkcore] Importing the module MSFT_RoleResource in force mode.
VERBOSE: [CONTOSO.COM]: [[WindowsFeature]NTFranmeworkcore] The operation 'Get-WindowsFeature' started: Net-Framework-Core
VERBOSE: [CONTOSO.COM]: [[WindowsFeature]NTFranmeworkcore] The operation 'Get-WindowsFeature' succeeded: NET-Framework-Core
VERBOSE: [CONTOSO.COM]: LCM: [ End Test ] [[WindowsFeature]NTFranmeworkcore] in 0.6710 seconds.
VERBOSE: [CONTOSO.COM]: LCM: [ Skip Set ] [[WindowsFeature]NTFranmeworkcore]
VERBOSE: [CONTOSO.COM]: LCM: [ End Resource ] [[WindowsFeature]NTFranmeworkcore]
VERBOSE: [CONTOSO.COM]: LCM: [ Start Resource ] [[xSQLServerSetup]SqlInstaller]
VERBOSE: [CONTOSO.COM]: LCM: [ Start Test ] [[xSQLServerSetup]SqlInstaller]
VERBOSE: [CONTOSO.COM]: [[xSQLServerSetup]SqlInstaller] Importing the module MSFT_xSQLServerSetup in force mode.
VERBOSE: [CONTOSO.COM]: [[xSQLServerSetup]SqlInstaller] Loading module from path 'C:\Program Files\WindowsPowerShell\Modules\xSQLServer\1.5.0.0\xPDT.psm1'.
VERBOSE: [CONTOSO.COM]: [[xSQLServerSetup]SqlInstaller] Importing function 'GetxPDTVariable'.
VERBOSE: [CONTOSO.COM]: [[xSQLServerSetup]SqlInstaller] Importing function 'NetUse'.
VERBOSE: [CONTOSO.COM]: [[xSQLServerSetup]SqlInstaller] Importing function 'ResolvePath'.
VERBOSE: [CONTOSO.COM]: [[xSQLServerSetup]SqlInstaller] Importing function 'StartWin32Process'.
VERBOSE: [CONTOSO.COM]: [[xSQLServerSetup]SqlInstaller] Importing function 'WaitForWin32ProcessEnd'.
VERBOSE: [CONTOSO.COM]: [[xSQLServerSetup]SqlInstaller] Path: Z:\setup.exe
VERBOSE: [CONTOSO.COM]: LCM: [ End Test ] [[xSQLServerSetup]SqlInstaller] in 1.5790 seconds.
VERBOSE: [CONTOSO.COM]: LCM: [ Start Set ] [[xSQLServerSetup]SqlInstaller]
VERBOSE: [CONTOSO.COM]: [[xSQLServerSetup]SqlInstaller] Importing the module MSFT_xSQLServerSetup in force mode.
VERBOSE: [CONTOSO.COM]: [[xSQLServerSetup]SqlInstaller] Loading module from path 'C:\Program Files\WindowsPowerShell\Modules\xSQLServer\1.5.0.0\xPDT.psm1'.
VERBOSE: [CONTOSO.COM]: [[xSQLServerSetup]SqlInstaller] Importing function 'GetxPDTVariable'.
VERBOSE: [CONTOSO.COM]: [[xSQLServerSetup]SqlInstaller] Importing function 'NetUse'.
VERBOSE: [CONTOSO.COM]: [[xSQLServerSetup]SqlInstaller] Importing function 'ResolvePath'.
VERBOSE: [CONTOSO.COM]: [[xSQLServerSetup]SqlInstaller] Importing function 'StartWin32Process'.
VERBOSE: [CONTOSO.COM]: [[xSQLServerSetup]SqlInstaller] Importing function 'WaitForWin32ProcessEnd'.
VERBOSE: [CONTOSO.COM]: [[xSQLServerSetup]SqlInstaller] Path: Z:\setup.exe
VERBOSE: [CONTOSO.COM]: [[xSQLServerSetup]SqlInstaller] Importing function 'GetxPDTVariable'.
VERBOSE: [CONTOSO.COM]: [[xSQLServerSetup]SqlInstaller] Importing function 'NetUse'.
VERBOSE: [CONTOSO.COM]: [[xSQLServerSetup]SqlInstaller] Importing function 'ResolvePath'.
VERBOSE: [CONTOSO.COM]: [[xSQLServerSetup]SqlInstaller] Importing function 'StartWin32Process'.
VERBOSE: [CONTOSO.COM]: [[xSQLServerSetup]SqlInstaller] Importing function 'WaitForWin32ProcessEnd'.
VERBOSE: [CONTOSO.COM]: [[xSQLServerSetup]SqlInstaller] Path: Z:\setup.exe
VERBOSE: [CONTOSO.COM]: [[xSQLServerSetup]SqlInstaller] Arguments: /Quiet="True" /IAcceptSQLServerLicenseTerms="True" /Action="Install" /AGTSVCSTARTUPTYPE=Automatic /
InstanceName="MSSQLSERVER" /Features="SQLENGINE,ADV_SSMS" /SQLSysAdminAccounts="installer"
VERBOSE: [CONTOSO.COM]: [[xSQLServerSetup]SqlInstaller] Process matching path 'Z:\setup.exe' started in process ID 1472
VERBOSE: [CONTOSO.COM]: [[xSQLServerSetup]SqlInstaller] Importing function 'GetxPDTVariable'.
VERBOSE: [CONTOSO.COM]: [[xSQLServerSetup]SqlInstaller] Importing function 'NetUse'.
VERBOSE: [CONTOSO.COM]: [[xSQLServerSetup]SqlInstaller] Importing function 'ResolvePath'.
VERBOSE: [CONTOSO.COM]: [[xSQLServerSetup]SqlInstaller] Importing function 'StartWin32Process'.
VERBOSE: [CONTOSO.COM]: [[xSQLServerSetup]SqlInstaller] Importing function 'WaitForWin32ProcessEnd'.
VERBOSE: [CONTOSO.COM]: [[xSQLServerSetup]SqlInstaller] Path: Z:\setup.exe
VERBOSE: [CONTOSO.COM]: [[xSQLServerSetup]SqlInstaller] Test-TargetResource returned false after calling set. | ErrorType: MSFT_xSQLServerSetup.TestFailedAfterSet
VERBOSE: [CONTOSO.COM]: LCM: [ End Set ] [[xSQLServerSetup]SqlInstaller] in 15.3120 seconds.
PowerShell DSC resource MSFT_xSQLServerSetup failed to execute Set-TargetResource functionality with error message: Test-TargetResource returned false after calling set.
+ CategoryInfo : InvalidOperation: (:) [], CimException
+ FullyQualifiedErrorId : ProviderOperationExecutionFailure
+ PSComputerName : CONTOSO.COM

VERBOSE: [CONTOSO.COM]: LCM: [ End Set ]
The SendConfigurationApply function did not succeed.
+ CategoryInfo : NotSpecified: (root/Microsoft/...gurationManager:String) [], CimException
+ FullyQualifiedErrorId : MI RESULT 1
+ PSComputerName : CONTOSO.COM

VERBOSE: Operation 'Invoke CimMethod' complete.
VERBOSE: Time taken for configuration job to complete is 27.741 seconds

PS C:\Program Files\WindowsPowerShell\Modules>

Here is the message summary:

IOverall summary:
Final result: Failed: see details below
Exit code (Decimal): -2147024895
Exit facility code: 7
Exit error code: 1
Exit message: Incorrect function.
Start time: 2016-07-29 11:58:02
End time: 2016-07-29 11:58:09
Requested action: Install
Exception help link: http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=12.0.2000.8&EvtType=0x60797DC7%400xAC9299FD&EvtType=0x60797DC7%400xAC9299FD

Machine Properties:
Machine name: CONTOSO.COM
Machine processor count: 4
OS version: Windows Server 2012
OS service pack:
OS region: United Kingdom
OS language: English (United States)
OS architecture: x64
Process architecture: 64 Bit
OS clustered: No

Product features discovered:
Product Instance Instance ID Feature Language Edition Version Clustered Configured

Package properties:
Description: Microsoft SQL Server 2014
ProductName: SQL Server 2014
Type: RTM
Version: 12
SPLevel: 0
Installation location: Z:\x64\setup
Installation edition: Enterprise

Product Update Status:
None discovered.

User Input Settings:
ACTION: Install
ADDCURRENTUSERASSQLADMIN: false
AGTSVCACCOUNT:
AGTSVCPASSWORD:
AGTSVCSTARTUPTYPE: Automatic
ASBACKUPDIR: Backup
ASCOLLATION: Latin1_General_CI_AS
ASCONFIGDIR: Config
ASDATADIR: Data
ASLOGDIR: Log
ASPROVIDERMSOLAP: 1
ASSERVERMODE: MULTIDIMENSIONAL
ASSVCACCOUNT:
ASSVCPASSWORD:
ASSVCSTARTUPTYPE: Automatic
ASSYSADMINACCOUNTS:
ASTEMPDIR: Temp
BROWSERSVCSTARTUPTYPE: Disabled
CLTCTLRNAME:
CLTRESULTDIR:
CLTSTARTUPTYPE: 0
CLTSVCACCOUNT:
CLTSVCPASSWORD:
CLTWORKINGDIR:
COMMFABRICENCRYPTION: 0
COMMFABRICNETWORKLEVEL: 0
COMMFABRICPORT: 0
CONFIGURATIONFILE:
CTLRSTARTUPTYPE: 0
CTLRSVCACCOUNT:
CTLRSVCPASSWORD:
CTLRUSERS:
ENABLERANU: false
ENU: true
ERRORREPORTING: false
FEATURES: SQLENGINE, ADV_SSMS
FILESTREAMLEVEL: 0
FILESTREAMSHARENAME:
FTSVCACCOUNT:
FTSVCPASSWORD:
HELP: false
IACCEPTSQLSERVERLICENSETERMS: true
INDICATEPROGRESS: false
INSTALLSHAREDDIR: C:\Program Files\Microsoft SQL Server
INSTALLSHAREDWOWDIR: C:\Program Files (x86)\Microsoft SQL Server
INSTALLSQLDATADIR:
INSTANCEDIR: C:\Program Files\Microsoft SQL Server
INSTANCEID:
INSTANCENAME: MSSQLSERVER
ISSVCACCOUNT: NT AUTHORITY\Network Service
ISSVCPASSWORD:
ISSVCSTARTUPTYPE: Automatic
MATRIXCMBRICKCOMMPORT: 0
MATRIXCMSERVERNAME:
MATRIXNAME:
NPENABLED: 0
PID: *****
QUIET: true
QUIETSIMPLE: false
ROLE:
RSINSTALLMODE: DefaultNativeMode
RSSHPINSTALLMODE: DefaultSharePointMode
RSSVCACCOUNT:
RSSVCPASSWORD:
RSSVCSTARTUPTYPE: Automatic
SAPWD:
SECURITYMODE:
SQLBACKUPDIR:
SQLCOLLATION: SQL_Latin1_General_CP1_CI_AS
SQLSVCACCOUNT:
SQLSVCPASSWORD:
SQLSVCSTARTUPTYPE: Automatic
SQLSYSADMINACCOUNTS: installer
SQLTEMPDBDIR:
SQLTEMPDBLOGDIR:
SQLUSERDBDIR:
SQLUSERDBLOGDIR:
SQMREPORTING: false
TCPENABLED: 0
UIMODE: Normal
UpdateEnabled: true
UpdateSource: MU
USEMICROSOFTUPDATE: false
X86: false

Configuration file: C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\Log\20160729_115801\ConfigurationFile.ini

Rules with failures:

Global rules:

Scenario specific rules:

Rules report file: C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\Log\20160729_115801\SystemConfigurationCheck_Report.htm

Exception summary:
The following is an exception stack listing the exceptions in outermost to innermost order
Inner exceptions are being indented

Exception type: System.IO.IOException
Message:
Incorrect function.

HResult : 0x80070001
Data: 
  DisableWatson = true
Stack: 
    at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
    at System.IO.File.InternalCopy(String sourceFileName, String destFileName, Boolean overwrite)
    at Microsoft.SqlServer.Configuration.UIExtension.HelpFileMigrator.CopyHelpFilestoLocal()
    at Microsoft.SqlServer.Configuration.UIExtension.StartAction.ExecuteAction(String actionId)
    at Microsoft.SqlServer.Chainer.Infrastructure.Action.Execute(String actionId, TextWriter errorStream)
    at Microsoft.SqlServer.Setup.Chainer.Workflow.ActionInvocation.<>c__DisplayClasse.<ExecuteActionWithRetryHelper>b__b()
    at Microsoft.SqlServer.Setup.Chainer.Workflow.ActionInvocation.ExecuteActionHelper(ActionWorker workerDelegate)
@johlju
Copy link
Member

johlju commented Jul 29, 2016

Could you please show how your config looks like?

@Arturas-K
Copy link
Contributor

Hi,

This error usually means that one or more features listed in configuration was not detected by test method after setup has completed.

I see that you are specified SQLENGINE,ADV_SSMS
Try adding SSMS feature to feature list: SQLENGINE,SSMS,ADV_SSMS.

I think i had similar issue a while back, so i'm specifying both in all my scripts, not sure if this is still needed thou.

You can also troubleshoot by executing Get-DscConfiguration on target machine, this should output what features are detected.

@bodunjo
Copy link
Author

bodunjo commented Jul 29, 2016

I ran Get-DSCConfiguration

Here is the result i got:

PS C:\Program Files\WindowsPowerShell\Modules> Get-dscConfiguration
WARNING: [LONSQL60A]: [] The GET operation will be carried against a pending configuration since the latest configuration has not converged yet.

ConfigurationName : SqlServerSetup
DependsOn :
ModuleName : PSDesiredStateConfiguration
ModuleVersion : 1.1
PsDscRunAsCredential :
ResourceId : [Script]DisableFirewall
SourceInfo :
Credential :
GetScript :
@{
Getscript = $Getscript
Setscript = $Setscript
Testscript= $Testscript
Result = -not('True' -in (Get-NetFirewallProfile -All).Enable)
}

Result : True
SetScript :
Set-NetFirewallProfile -All -Enabled False -verbose

TestScript :
$status = -not('True' -in (Get-NetFirewallProfile -All).Enabled)
$status -eq $True

PSComputerName :
CimClassName : MSFT_ScriptResource

ConfigurationName : SqlServerSetup
DependsOn : {[Script]DisableFirewall}
ModuleName : PSDesiredStateConfiguration
ModuleVersion :
PsDscRunAsCredential :
ResourceId : [File]DSCResourceFolder
SourceInfo :
Attributes : {system, directory}
Checksum :
Contents :
CreatedDate : 22/08/2013 16:39:31
Credential :
DestinationPath : C:\Program Files\WindowsPowerShell\Modules
Ensure : present
Force :
MatchSource :
ModifiedDate : 28/07/2016 17:50:10
Recurse :
Size : 0
SourcePath :
SubItems :
Type : directory
PSComputerName :
CimClassName : MSFT_FileDirectoryConfiguration

ConfigurationName : SqlServerSetup
DependsOn : {[File]DSCResourceFolder}
ModuleName : PSDesiredStateConfiguration
ModuleVersion : 1.1
PsDscRunAsCredential :
ResourceId : [WindowsFeature]NTFranmeworkcore
SourceInfo :
Credential :
DisplayName : .NET Framework 3.5 (includes .NET 2.0 and 3.0)
Ensure : Present
IncludeAllSubFeature : False
LogPath :
Name : NET-Framework-Core
Source :
PSComputerName :
CimClassName : MSFT_RoleResource

ConfigurationName : SqlServerSetup
DependsOn : {[WindowsFeature]NTFranmeworkcore}
ModuleName : xSQLServer
ModuleVersion : 1.5.0.0
PsDscRunAsCredential :
ResourceId : [xSQLServerSetup]SqlInstaller
SourceInfo :
AgtSvcAccount :
AgtSvcAccountUsername :
ASBackupDir :
ASCollation :
ASConfigDir :
ASDataDir :
ASLogDir :
ASSvcAccount :
ASSvcAccountUsername :
ASSysAdminAccounts :
ASTempDir :
BrowserSvcStartupType :
ErrorReporting :
Features :
ForceReboot :
FTSvcAccount :
FTSvcAccountUsername :
InstallSharedDir :
InstallSharedWOWDir :
InstallSQLDataDir :
InstanceDir :
InstanceID :
InstanceName : MSSQLSERVER
ISSvcAccount :
ISSvcAccountUsername :
PID :
RSSvcAccount :
RSSvcAccountUsername :
SAPwd :
SecurityMode :
SetupCredential :
SourceCredential :
SourceFolder :
SourcePath : Z:
SQLBackupDir :
SQLCollation :
SQLSvcAccount :
SQLSvcAccountUsername :
SQLSysAdminAccounts :
SQLTempDBDir :
SQLTempDBLogDir :
SQLUserDBDir :
SQLUserDBLogDir :
SQMReporting :
SuppressReboot :
UpdateEnabled :
UpdateSource :
PSComputerName :
CimClassName : MSFT_xSQLServerSetup

@Arturas-K
Copy link
Contributor

so SSMS failed to install, you should look at setup logs.
They can be found at C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Log<Date_time>
You should be able to find a cause there.

Maybe you are missing a prerequisite.

Have you tried with specifying SSMS and ADV_SSMS features?

@bodunjo
Copy link
Author

bodunjo commented Jul 29, 2016

I added the setup long at the bottom of the initial post.

Get Outlook for Android

On Fri, Jul 29, 2016 at 1:27 PM +0100, "Arturas Kuznecovas" notifications@github.com wrote:

so SSMS failed to install, you should look at setup logs.
They can be found at C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Log<Date_time>
You should be able to find a cause there.

Maybe you are missing a prerequisite.

Have you tried with specifying SSMS and ADV_SSMS features?


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
#88 (comment)

@bodunjo
Copy link
Author

bodunjo commented Jul 29, 2016

Yes i did. i added it as shown in the below result:
VERBOSE: [LONSQL60A]: [[xSQLServerSetup]SqlInstaller] Process matching path 'Z:\setup.exe' started in process ID 4632
VERBOSE: [LONSQL60A]: [[xSQLServerSetup]SqlInstaller] Importing function 'GetxPDTVariable'.
VERBOSE: [LONSQL60A]: [[xSQLServerSetup]SqlInstaller] Importing function 'NetUse'.
VERBOSE: [LONSQL60A]: [[xSQLServerSetup]SqlInstaller] Importing function 'ResolvePath'.
VERBOSE: [LONSQL60A]: [[xSQLServerSetup]SqlInstaller] Importing function 'StartWin32Process'.
VERBOSE: [LONSQL60A]: [[xSQLServerSetup]SqlInstaller] Importing function 'WaitForWin32ProcessEnd'.
VERBOSE: [LONSQL60A]: [[xSQLServerSetup]SqlInstaller] Path: Z:\setup.exe
VERBOSE: [LONSQL60A]: [[xSQLServerSetup]SqlInstaller] Features found: ''
VERBOSE: [LONSQL60A]: [[xSQLServerSetup]SqlInstaller] Unable to find feature 'SQLENGINE' in ''
VERBOSE: [LONSQL60A]: [[xSQLServerSetup]SqlInstaller] Unable to find feature 'SSMS' in ''
VERBOSE: [LONSQL60A]: [[xSQLServerSetup]SqlInstaller] Unable to find feature 'ADV_SSMS' in ''
VERBOSE: [LONSQL60A]: [[xSQLServerSetup]SqlInstaller] Test-TargetResource returned false after calling set. | ErrorType: MSFT_xSQLServerSetup.TestFailedAfterSet
VERBOSE: [LONSQL60A]: LCM: [ End Set ] [[xSQLServerSetup]SqlInstaller] in 15.1870 seconds.
PowerShell DSC resource MSFT_xSQLServerSetup failed to execute Set-TargetResource functionality with error message: Test-TargetResource returned false after calling set.
+ CategoryInfo : InvalidOperation: (:) [], CimException
+ FullyQualifiedErrorId : ProviderOperationExecutionFailure
+ PSComputerName : LONSQL60A

VERBOSE: [LONSQL60A]: LCM: [ End Set ]
The SendConfigurationApply function did not succeed.
+ CategoryInfo : NotSpecified: (root/Microsoft/...gurationManager:String) [], CimException
+ FullyQualifiedErrorId : MI RESULT 1
+ PSComputerName : LONSQL60A

VERBOSE: Operation 'Invoke CimMethod' complete.
VERBOSE: Time taken for configuration job to complete is 27.103 seconds

@johlju
Copy link
Member

johlju commented Jul 29, 2016

I think I have seen this error before. I can be wrong, but I think it was when SourceCredential was not set. When SourceCredential is set, it does RoboCopy to local disk before starting setup. If SourceCredential is not set then it tries to start the setup from the SourcePath+SourceFolder, and accessing it over UNC, and at that point I think I got CIMSession error.

Can you verify if you are using SourceCredential or not? So we can rule that out.

This is how my config looks like. I used it yesterday with the latest dev-branch without any problems.

xSQLServerSetup InstallSqlServer
{
    InstanceName = $Node.SqlInstanceName
    Features= $Node.SqlInstallFeatures
    BrowserSvcStartupType = 'Automatic'
    SQLCollation = 'Latin1_General_CI_AS_KS_WS'
    SQLSvcAccount = $SqlServiceCredentialNode2
    AgtSvcAccount = $SqlAgentServiceCredentialNode2
    SQLSysAdminAccounts = $SqlAdministratorCredential.UserName
    SetupCredential = $SqlInstallCredential

    SourcePath = $Node.SourcePath
    SourceFolder = $Node.SourceFolder
    SourceCredential = $SqlInstallCredential

    UpdateSource = '.\Updates'
    UpdateEnabled = 'True'

    SuppressReboot = $False
    ForceReboot = $False
}

@bodunjo
Copy link
Author

bodunjo commented Jul 29, 2016

Well, everything was copied locally and and the ISO files ae mounted on the server and filled in the administrator's credential, the share path's credential including the SA account credential. Not sure why this is not working.

@johlju
Copy link
Member

johlju commented Jul 29, 2016

And as @Arturas-K say maybe you are missing a prereq? I do the following before installing SQL, just to make sure they are there.

        WindowsFeature NET35 {
           Name = 'NET-Framework-Core'
           Source = $node.WindowsSourceSxs
           Ensure = 'Present'
        }

        WindowsFeature NET45 {
           Name = 'NET-Framework-45-Core'
           Ensure = 'Present'
        }

Alos, if setup process is starting, as @Arturas-K say, check the SQL setup logs, because then it might be something SQL specific error (outside of DSC).

@kwirkykat kwirkykat added bug The issue is a bug. waiting for author response The pull request is waiting for the author to respond to comments in the pull request. labels Aug 2, 2016
@bodunjo
Copy link
Author

bodunjo commented Aug 9, 2016

I've just realised that some of the SQL features will not work and will throw the error message above.
Some of the features that are buggy as far as my testing goes are: FullText,SNAC_SDK,Conn,DQ,BC,DQC,Replication,MDS,Tools.
Not sure as to what the fixes are. Quite new to PS DSC.

@Arturas-K
Copy link
Contributor

Yes you are correct not all features are detected by Get method, so it will be installed but then not detected and will throw error that test method failed after set.

But one correction, Replication feature does work, i have fixed that in PR #20 and i'm using it to build my devtest environments so it is definitely working on SQL2008R2 and SQL2012

Regards

@bodunjo
Copy link
Author

bodunjo commented Aug 9, 2016

OK. I've never used this on SQL server 2008,R2 and 2012. All my testing has been on SQL 2014 so far.
I got another question that is completely unrelated. What's the best way to implement the post SQL server installation configurations using DSC

----- Reply message -----
From: "Arturas Kuznecovas" notifications@github.com
To: "PowerShell/xSQLServer" xSQLServer@noreply.github.com
Cc: "bodunjo" bodunjo@live.co.uk, "Author" author@noreply.github.com
Subject: [PowerShell/xSQLServer] PowerShell DSC resource MSFT_xSQLServerSetup failed to execute Set-TargetResource functionality with error message: Test-TargetResource returned false after calling set. (#88)
Date: Tue, Aug 9, 2016 08:04

Yes you are correct not all features are detected by Get method, so it will be installed but then not detected and will throw error that test method failed after set.

But one correction, Replication feature does work, i have fixed that in PR #20 and i'm using it to build my devtest environments so it is definitely working on SQL2008R2 and SQL2012

Regards


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
#88 (comment)

@bodunjo
Copy link
Author

bodunjo commented Aug 11, 2016

I'm finding it difficult to install a default instance. Also, how do i set up dedicated SQL service accounts based on IS,AS,RS,DE,FT on each environment? Not sure if i'll have to leave the instance name empty when installing a default instance or not. Error message below:

VERBOSE: [LONSQL60B]: [[xSQLServerSetup]SqlInstaller] Path: F:\setup.exe
VERBOSE: [LONSQL60B]: [[xSQLServerSetup]SqlInstaller] Detecting replication feature
VERBOSE: [LONSQL60B]: [[xSQLServerSetup]SqlInstaller] Reading registry key HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL12.DBADSC\ConfigurationState
VERBOSE: [LONSQL60B]: [[xSQLServerSetup]SqlInstaller] Registry entry SQL_Replication_Core_Inst = 1
VERBOSE: [LONSQL60B]: [[xSQLServerSetup]SqlInstaller] Replication feature detected
Exception calling "Connect" with "1" argument(s): "The 'DBADSC' instance was not found on the 'localhost' server."
+ CategoryInfo : NotSpecified: (:) [], CimException
+ FullyQualifiedErrorId : ConnectionException
+ PSComputerName : LONSQL60B

VERBOSE: [LONSQL60B]: LCM: [ End Test ] [[xSQLServerSetup]SqlInstaller] in 61.3920 seconds.
The PowerShell DSC resource '[xSQLServerSetup]SqlInstaller' with SourceInfo '::115::5::xSqlServerSetup' threw one or more non-terminating errors while running the Test-TargetResource
functionality. These errors are logged to the ETW channel called Microsoft-Windows-DSC/Operational. Refer to this channel for more details.
+ CategoryInfo : InvalidOperation: (:) [], CimException
+ FullyQualifiedErrorId : NonTerminatingErrorFromProvider
+ PSComputerName : LONSQL60B

VERBOSE: [LONSQL60B]: LCM: [ Start Resource ] [[WindowsFeature]WindowsPowerShell50]
VERBOSE: [LONSQL60B]: LCM: [ Start Test ] [[WindowsFeature]WindowsPowerShell50]
VERBOSE: [LONSQL60B]: [[WindowsFeature]WindowsPowerShell50] The operation 'Get-WindowsFeature' started: PowerShell
VERBOSE: [LONSQL60B]: [[WindowsFeature]WindowsPowerShell50] The operation 'Get-WindowsFeature' succeeded: PowerShell
VERBOSE: [LONSQL60B]: LCM: [ End Test ] [[WindowsFeature]WindowsPowerShell50] in 0.7490 seconds.

@johlju
Copy link
Member

johlju commented Nov 4, 2016

@bodunjo Sorry for taking so long to answer. You need to set the instance name to MSSQLSERVER for the default instance.

You need to see each parameter to a PSCredential object, like $cred = Get-Credential, to use separate service accounts. For parameters you can look at the README.md

For AS use parameter ASSvcAccount
For IS use parameter ISSvcAccount
For RS use parameter RSSvcAccount
For DE use parameter SQLSvcAccount
For FT use parameter FTSvcAccount

Let me know if you need help with anything else. 😄

@johlju
Copy link
Member

johlju commented Jan 1, 2017

@bodunjo I'm closing this issue since we have not heard anything more from you in a while. Please feel free to open up the issue again if you need further help.

@johlju johlju closed this as completed Jan 1, 2017
@vors vors removed the waiting for author response The pull request is waiting for the author to respond to comments in the pull request. label Jan 1, 2017
@bodunjo
Copy link
Author

bodunjo commented Jan 10, 2017

@johlju thanks a million for getting back to me. I've just had the time to test again. I did what you recommended above to try SQL 2016 installation. The install went ok but the service accounts are not applied still. it's showing as SQLAgent$BAUTEST3 intead of using the designated service accounts.

Here is my script:

$config = @{
  AllNodes = @(
        #@{NodeName = "Server1";PsDscAllowPlaintextPassword = $true}
       

   )
}
configuration TestScript {

PARAM ( 
        [PSCredential]$SACredential,
        [string]$ModuleSourcePath,
        [string]$ModuleDestinationPath,
        [string]$NetSourcePath,
        #[string]$InstanceName,
        [PSCredential]$ShareCredential,
        [PSCredential]$SourceCredential,
        [PSCredential]$Cred,
        [PSCredential]$Setupcredential,
        [PSCredential]$AgtSvcAccount,
        [PSCredential]$SQLSvcAccount,
       
        #[PSCredential]$Username, # = "domain\username",
        [PSCredential]$Password # = (Get-Content c:\Temp\password.txt | ConvertTo-SecureString)
        #[PSCredential]$AGsvcAccount,
        #[PSCredential]$DEsvcAccount
 
     )



Import-DscResource -Module xSQLServer,PSDesiredStateConfiguration, xActiveDirectory,xstorage

$AGsvcAccount = $SQLServer + "AG"
$DEsvcAccount = $SQLServer + "DE"
$FTSvcAccount = $SQLServer + "FT"
$ASSvcAccount = $SQLServer + "AS"
$ISSvcAccount = $SQLServer + "IS"
$RSSvcAccount = $SQLServer + "RS"
$ASSvcAccount = $SQLServer + "AS"
       
       
$SQLSvcAccountUsername = $DomainName + "\" + $DEsvcAccount
$AgtSvcAccountUsername = $DomainName + "\" + $AGsvcAccount
$FTSvcAccountUsernamee = $DomainName + "\" + $FTSvcAccount
$RSSvcAccountUsername = $DomainName + "\" + $RSSvcAccount
$ISSvcAccountUsername = $DomainName + "\" + $ISSvcAccount
$ASSvcAccountUsername = $DomainName + "\" + $ASSvcAccount   

    
$InstanceName = "BAUTEST4" #fill in the name of the instance if not default
$SQLServer = $env:computername
$DomainName = $env:USERDOMAIN






Node $Allnodes.Nodename {



        Log ParamLog
        {
            Message = "Running SQLInstall. PackagePath = $PackagePath"
        }

  Script ShowUser
        {
            GetScript = { }
            TestScript = { $False }
            SetScript = 
            {
            write-verbose "User: $([System.Security.Principal.WindowsIdentity]::GetCurrent().Name)"
            write-verbose "Current User: $env:UserName"
            }
        }

   File ModuleCopy
        {
            Ensure = "Present"  # You can also set Ensure to "Absent"
            Type = "Directory" # Default is "File".
            Recurse = $true # Ensure presence of subdirectories, too
            SourcePath = $ModuleSourcePath
            DestinationPath = $ModuleDestinationPath 
            Dependson = "[Script]ShowUser"  
        }




   WindowsFeature WindowsPowerShell50 
		{
			Ensure = 'Present' 
			Name = 'PowerShell'
            Dependson = "[File]ModuleCopy"
            PsDscRunAsCredential = $cred
		}

		
  WindowsFeature WindowsPowerShellISE 
		{
			Ensure = 'Present' 
			Name = 'PowerShell-ISE'
            Dependson = "[WindowsFeature]WindowsPowerShell50"
            PsDscRunAsCredential = $cred
		}


WindowsFeature ActiveDirectoryModuleForWindowsPowerShell 
		{
			Ensure = 'Present' 
			Name = 'RSAT-AD-PowerShell'
            Dependson = "[WindowsFeature]WindowsPowerShellISE"
            PsDscRunAsCredential = $cred
		}

 


  xADUser $AGsvcAccount
		{
			#DomainAdministratorCredential = $cred
			DomainName = $DomainName
			UserName =  $AGsvcAccount
			Password = $password
			PasswordNeverExpires = $true
			Ensure = 'Present'
            Path = 'OU=Service Logons - non-compliant,OU=IT,DC=domain,DC=com'
            PsDscRunAsCredential = $cred
            Dependson = "[WindowsFeature]ActiveDirectoryModuleForWindowsPowerShell"
            Enabled = $true
		}

  xADUser $DEsvcAccount
		{
			#DomainAdministratorCredential = $cred
			DomainName = $DomainName
			UserName =  $DEsvcAccount
			Password = $password
			PasswordNeverExpires = $true
			Ensure = 'Present'
            Path = 'OU=Service Logons - non-compliant,OU=IT,DC=domain,DC=com'
            PsDscRunAsCredential = $cred
            Dependson = "[xADUser]$AGsvcAccount"
            Enabled = $true
		}



  xMountImage OSImage
        {
            ImagePath = "\\Share\SQL Team\SQLInstalls\SW_DVD9_Windows_Svr_Std_and_DataCtr_2012_R2_64Bit_English_-4_MLF_X19-82891.ISO"
            #Name = "Win2012R2"
            DependsOn = "[File]ModuleCopy"
            DriveLetter = "O:"
            Ensure = "Present"
            #PsDscRunAsCredential = $cred
        }



  xMountImage SQLImage
        {
            ImagePath = "\\Share\SQL Team\SQLInstalls\SQL Server 2016 Developer\en_sql_server_2016_developer_x64_dvd_8777069.iso"
            #Name = "SQL2016"
            DependsOn = "[xMountImage]OSImage"
            DriveLetter = "K:"
            Ensure = "Present"
            #PsDscRunAsCredential = $cred
        }

       
 
 WindowsFeature NetFramework35Core
        {
            Name = "NET-Framework-Core"
            Ensure = "Present"
            Source = "O:\sources\sxs"
            DependsOn = "[xMountImage]OSImage"
        }
 
 WindowsFeature NetFramework45Core
        {
            Name = "NET-Framework-45-Core"
            Ensure = "Present"
            Source = "O:\sources\sxs"
            DependsOn = "[WindowsFeature]NetFramework35Core"
        }

        # Install SqlServer using ini file
       
   <#    
      Script InstallSQL
        {

             GetScript =
            {
               # Do Nothing
                
            }

             SetScript = {
             $currentTime = Get-Date
             $InstallSQL = C:\DBA\SQLDSC\SQLInstaller.ps1

            }

          TestScript = {
            
                $false
            }
            Dependson = "[xMountImage]SQLImage"

        }


      
#>
 xSQLServersetup SQL2016

     {
        InstanceName = $InstanceName 
        Setupcredential = $Setupcredential
        SApwd = $SACredential
        SourcePath = 'K:'
        SourceFolder = ""
        FEATURES="SQLENGINE,RS,IS,SQL" #FullText,SNAC_SDK,Conn,DQ,BC,DQC,Replication,MDS,Tools
        InstallSharedDir = "C:\Program Files"
        InstallSharedWOWDir = "C:\Program Files (x86)"
        InstanceDir = "D:\Program Files\Microsoft SQL Server"
        InstallSQLDataDir = "H:\SQLData"
        SQLUserDBDir = "H:\SQLData"
        SQLUserDBLogDir = "L:\SQLLogs"
        SQLTempDBDir = "H:\SQLTemp\$InstanceName"
        SQLTempDBLogDir = "L:\SQLTempLog\$InstanceName"
        SQLBackupDir = "H:\SQLData"
        ASDataDir = "C:\Program Files"
        ASLogDir = "C:\Program Files"
        ASBackupDir = "C:\Program Files"
        ASTempDir = "C:\Program Files"
        ASConfigDir = "C:\Program Files"
        UpdateSource = "MU" # set this to windows update, otherwise it will use the default and cause the setup to crash
        UpdateEnabled = 'True'
        SuppressReboot = $False
        ForceReboot = $False
        PsDscRunAsCredential = $cred
        FTSvcAccount = $cred
        ASSvcAccount = $cred
        ASSysAdminAccounts = $cred
        ISSvcAccount = $cred
        RSSvcAccount = $cred
        ASCollation = 'Latin1_General_CI_AS_KS_WS'
        SQLSvcAccount = $SQLSvcAccountCred
        SQLCollation = 'Latin1_General_CI_AS_KS_WS'
        AGTSVCACCOUNT= $AgtSvcAccountCred
        SQLSysAdminAccounts = "domain\dl_sqladmins"
        #PID =
        Dependson = "[WindowsFeature]NetFramework45Core"
     }


Script InstallSSMS
        {

             GetScript =
            {
                # Do Nothing 
                
            }

            SetScript = 
            {
            $currentTime = Get-Date
            $InstallSSMS = C:\DBA\SQLDSC\SSMSInstaller2.ps1  

            }

            TestScript = 
            {
            
                $false
            }
            Dependson = "[xSQLServersetup]SQL2016"

        }


         # Set LCM to reboot if needed
 LocalConfigurationManager
        {
            DebugMode = "All"
            RebootNodeIfNeeded = $true
            ConfigurationMode = 'ApplyAndAutoCorrect'
            AllowModuleOverwrite = $true
            RefreshMode = 'Push'
            ActionAfterReboot = 'ContinueConfiguration'
           
        }
  }
        
    }

    

#Read-Host –AsSecureString | ConvertFrom-SecureString | Out-File C:\DBA\SQLDSC\SACredential.txt
#Read-Host –AsSecureString | ConvertFrom-SecureString | Out-File C:\DBA\SQLDSC\password.txt
#Read-Host –AsSecureString | ConvertFrom-SecureString | Out-File C:\DBA\SQLDSC\AgtSvcAccountpassword.txt
#Read-Host –AsSecureString | ConvertFrom-SecureString | Out-File C:\DBA\SQLDSC\SQLSvcAccountpassword.txt


$Username = "domain\domain\username"
$password = Get-Content C:\DBA\SQLDSC\password.txt | ConvertTo-SecureString
$SApassword = Get-Content C:\DBA\SQLDSC\SACredential.txt | ConvertTo-SecureString
$Cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $Username, $password
#$InstanceName = "SharePoint" #fill in the name of the instance if not default


#$AgtSvcAccountUsername = $AgtSvcAccountUsername
#$SQLSvcAccountUsername = $SQLSvcAccountUsername
$AgtSvcAccountpassword = Get-Content C:\DBA\SQLDSC\AgtSvcAccountpassword.txt | ConvertTo-SecureString
$SQLSvcAccountpassword = Get-Content C:\DBA\SQLDSC\SQLSvcAccountpassword.txt | ConvertTo-SecureString
$AgtSvcAccountCred = new-object -typename System.Management.Automation.PSCredential -argumentlist $AgtSvcAccountUsername, $AgtSvcAccountpassword
$SQLSvcAccountCred = new-object -typename System.Management.Automation.PSCredential -argumentlist $SQLSvcAccountUsername, $SQLSvcAccountpassword



                      $values = @{
                                "Setupcredential" =$cred;
                                "ShareCredential" = $cred;
                                "SACredential" = $cred;
                                "SourceCredential" = $cred;
                                "ModuleSourcePath" = "\\Share\SQL Team\SQLInstalls\SQLInstaller\Modules";
                                "ModuleDestinationPath" = "C:\Program Files\WindowsPowerShell\Modules";
                                "NetSourcePath" = "O:\sources";
                                #"InstanceName" = 'BAU'
                                #"AGTSVCACCOUNT=" = $AgtSvcAccountCred;
                                "SQLSvcAccount" = $cred
                                };

CD C:\DBA\SQLDSC

Testscript @values -configurationdata $config
Start-DscConfiguration  -Path C:\DBA\SQLDSC\TestScript -Credential (Get-Credential -UserName "domain\domain\username" -Message 'Enter Credential for configuration') -Wait -Verbose -force

and here is the error message:

VERBOSE: [Server1]:                            [[xSQLServerSetup]SQL2016::[TestScript]::[TestScript]] Importing function 'GetxPDTVariable'.
VERBOSE: [Server1]:                            [[xSQLServerSetup]SQL2016::[TestScript]::[TestScript]] Importing function 'NetUse'.
VERBOSE: [Server1]:                            [[xSQLServerSetup]SQL2016::[TestScript]::[TestScript]] Importing function 'ResolvePath'.
VERBOSE: [Server1]:                            [[xSQLServerSetup]SQL2016::[TestScript]::[TestScript]] Importing function 'StartWin32Process'.
VERBOSE: [Server1]:                            [[xSQLServerSetup]SQL2016::[TestScript]::[TestScript]] Importing function 'WaitForWin32ProcessEnd'.
VERBOSE: [Server1]:                            [[xSQLServerSetup]SQL2016::[TestScript]::[TestScript]] Path: K:\setup.exe
VERBOSE: [Server1]:                            [[xSQLServerSetup]SQL2016::[TestScript]::[TestScript]] Test-TargetResource returned false after calling set. 
| ErrorType: MSFT_xSQLServerSetup.TestFailedAfterSet
VERBOSE: [Server1]: LCM:  [ End    Set      ]  [[xSQLServerSetup]SQL2016::[TestScript]::[TestScript]]  in 54.4550 seconds.
PowerShell DSC resource MSFT_xSQLServerSetup  failed to execute Set-TargetResource functionality with error message: Test-TargetResource returned false after 
calling set. 
    + CategoryInfo          : InvalidOperation: (:) [], CimException
    + FullyQualifiedErrorId : ProviderOperationExecutionFailure
    + PSComputerName        : Server1
 
VERBOSE: [Server1]: LCM:  [ End    Set      ]
The SendConfigurationApply function did not succeed.
    + CategoryInfo          : NotSpecified: (root/Microsoft/...gurationManager:String) [], CimException
    + FullyQualifiedErrorId : MI RESULT 1
    + PSComputerName        : Server1
 
VERBOSE: Operation 'Invoke CimMethod' complete.
VERBOSE: Time taken for configuration job to complete is 65.472 seconds

Overall summary:
  Final result:                  Failed: see details below
  Exit code (Decimal):           -2061762559
  Exit facility code:            1308
  Exit error code:               1
  Exit message:                  The credentials you provided for the 'SQLAgent$BAUTEST4' service is invalid.
  Start time:                    2017-01-10 15:58:04
  End time:                      2017-01-10 15:58:44
  Requested action:              Install

Setup completed with required actions for features.
Troubleshooting information for those features:
  Next step for SQLEngine:       SQL Server Setup was canceled before completing the operation. Try the setup process again.
  Next step for Replication:     SQL Server Setup was canceled before completing the operation. Try the setup process again.
  Next step for FullText:        SQL Server Setup was canceled before completing the operation. Try the setup process again.
  Next step for DQ:              SQL Server Setup was canceled before completing the operation. Try the setup process again.
  Next step for RS:              SQL Server Setup was canceled before completing the operation. Try the setup process again.

Install Summary:


Package properties:
  Description:                   Microsoft SQL Server 2016 
  ProductName:                   SQL Server 2016
  Type:                          RTM
  Version:                       13
  SPLevel:                       0
  Installation location:         K:\x64\setup\
  Installation edition:          Developer

Product Update Status:
  None discovered.

User Input Settings:
  ACTION:                        Install
  ADDCURRENTUSERASSQLADMIN:      false
  AGTSVCACCOUNT:                 domain\server1AG
  AGTSVCPASSWORD:                *****
  AGTSVCSTARTUPTYPE:             Automatic
  ASBACKUPDIR:                   Backup
  ASCOLLATION:                   Latin1_General_CI_AS
  ASCONFIGDIR:                   Config
  ASDATADIR:                     Data
  ASLOGDIR:                      Log
  ASPROVIDERMSOLAP:              1
  ASSERVERMODE:                  MULTIDIMENSIONAL
  ASSVCACCOUNT:                  <empty>
  ASSVCPASSWORD:                 <empty>
  ASSVCSTARTUPTYPE:              Automatic
  ASSYSADMINACCOUNTS:            <empty>
  ASTELSVCACCT:                  <empty>
  ASTELSVCPASSWORD:              <empty>
  ASTELSVCSTARTUPTYPE:           0
  ASTEMPDIR:                     Temp
  BROWSERSVCSTARTUPTYPE:         Disabled
  CLTCTLRNAME:                   <empty>
  CLTRESULTDIR:                  <empty>
  CLTSTARTUPTYPE:                0
  CLTSVCACCOUNT:                 <empty>
  CLTSVCPASSWORD:                <empty>
  CLTWORKINGDIR:                 <empty>
  COMMFABRICENCRYPTION:          0
  COMMFABRICNETWORKLEVEL:        0
  COMMFABRICPORT:                0
  CONFIGURATIONFILE:             
  CTLRSTARTUPTYPE:               0
  CTLRSVCACCOUNT:                <empty>
  CTLRSVCPASSWORD:               <empty>
  CTLRUSERS:                     <empty>
  ENABLERANU:                    false
  ENU:                           true
  EXTSVCACCOUNT:                 <empty>
  EXTSVCPASSWORD:                <empty>
  FEATURES:                      SQLENGINE, REPLICATION, FULLTEXT, DQ, RS
  FILESTREAMLEVEL:               0
  FILESTREAMSHARENAME:           <empty>
  FTSVCACCOUNT:                  NT Service\MSSQLFDLauncher$BAUTEST4
  FTSVCPASSWORD:                 <empty>
  HELP:                          false
  IACCEPTROPENLICENSETERMS:      false
  IACCEPTSQLSERVERLICENSETERMS:  true
  INDICATEPROGRESS:              false
  INSTALLSHAREDDIR:              C:\Program Files\Microsoft SQL Server\
  INSTALLSHAREDWOWDIR:           C:\Program Files (x86)\Microsoft SQL Server\
  INSTALLSQLDATADIR:             H:\SQLData
  INSTANCEDIR:                   D:\Program Files\Microsoft SQL Server
  INSTANCEID:                    BAUTEST4
  INSTANCENAME:                  BAUTEST4
  ISSVCACCOUNT:                  NT AUTHORITY\Network Service
  ISSVCPASSWORD:                 <empty>
  ISSVCSTARTUPTYPE:              Automatic
  ISTELSVCACCT:                  <empty>
  ISTELSVCPASSWORD:              <empty>
  ISTELSVCSTARTUPTYPE:           0
  MATRIXCMBRICKCOMMPORT:         0
  MATRIXCMSERVERNAME:            <empty>
  MATRIXNAME:                    <empty>
  MRCACHEDIRECTORY:              
  NPENABLED:                     0
  PBDMSSVCACCOUNT:               <empty>
  PBDMSSVCPASSWORD:              <empty>
  PBDMSSVCSTARTUPTYPE:           0
  PBENGSVCACCOUNT:               <empty>
  PBENGSVCPASSWORD:              <empty>
  PBENGSVCSTARTUPTYPE:           0
  PBPORTRANGE:                   <empty>
  PBSCALEOUT:                    false
  PID:                           *****
  QUIET:                         true
  QUIETSIMPLE:                   false
  ROLE:                          
  RSINSTALLMODE:                 DefaultNativeMode
  RSSHPINSTALLMODE:              DefaultSharePointMode
  RSSVCACCOUNT:                  NT Service\ReportServer$BAUTEST4
  RSSVCPASSWORD:                 <empty>
  RSSVCSTARTUPTYPE:              Automatic
  SAPWD:                         <empty>
  SECURITYMODE:                  <empty>
  SQLBACKUPDIR:                  H:\SQLData
  SQLCOLLATION:                  Latin1_General_CI_AS_KS_WS
  SQLSVCACCOUNT:                 domain\server1DE
  SQLSVCINSTANTFILEINIT:         false
  SQLSVCPASSWORD:                *****
  SQLSVCSTARTUPTYPE:             Automatic
  SQLSYSADMINACCOUNTS:           domain\user1,domain\dl_sqladmins
  SQLTELSVCACCT:                 NT Service\SQLTELEMETRY$BAUTEST4
  SQLTELSVCPASSWORD:             <empty>
  SQLTELSVCSTARTUPTYPE:          Automatic
  SQLTEMPDBDIR:                  H:\SQLTemp\BAUTEST4
  SQLTEMPDBFILECOUNT:            8
  SQLTEMPDBFILEGROWTH:           64
  SQLTEMPDBFILESIZE:             8
  SQLTEMPDBLOGDIR:               L:\SQLTempLog\BAUTEST4
  SQLTEMPDBLOGFILEGROWTH:        64
  SQLTEMPDBLOGFILESIZE:          8
  SQLUSERDBDIR:                  H:\SQLData
  SQLUSERDBLOGDIR:               L:\SQLLogs
  SUPPRESSPRIVACYSTATEMENTNOTICE: false
  TCPENABLED:                    0
  UIMODE:                        Normal
  UpdateEnabled:                 true
  UpdateSource:                  MU
  USEMICROSOFTUPDATE:            false
  X86:                           false

@johlju
Copy link
Member

johlju commented Jan 21, 2017

Hello again @bodunjo! Glad to here you gotten further.

Parameter AGTSVCACCOUNT is assigned the value in $AgtSvcAccountCred, but $AgtSvcAccountCred is never assigned in the configuration. It is assigned outside of the configuration.

If you do the following I think that it should work.

1. Un-comment this row in the $values hash table.

#"AGTSVCACCOUNT=" = $AgtSvcAccountCred;

2. Rename this Configuration parameter on this row

From

[PSCredential]$AgtSvcAccount,

To

[PSCredential]$AgentServiceAccountCredentials,

3. And change this row for the xSQLServerSetup resource.

From

AGTSVCACCOUNT= $AgtSvcAccountCred

To

AGTSVCACCOUNT= $AgentServiceAccountCredentials

@johlju johlju reopened this Jan 21, 2017
@johlju johlju added the question The issue is a question. label Jan 21, 2017
@bodunjo
Copy link
Author

bodunjo commented Jan 26, 2017

@johlju Thanks a million. This worked. I had to go through all the available params in the .psm1 files of the DSCResources of the SQLServerSetup.
I managed to install SQLEngine for SQL 2016 without any further issues.
But i realised that the SA account comes disabled. Do you know how i can get this enabled during the installation?

@randomnote1
Copy link
Contributor

@bodunjo The SA account is always disabled when using Windows Authentication mode. To get the SA account enabled, you will need to use Mixed Authentication Mode.

@bodunjo
Copy link
Author

bodunjo commented Jan 27, 2017

@randomnote1 Thanks. I never realised that SecurityMode property is available. I've just tested and it works.

@bodunjo bodunjo closed this as completed Jan 27, 2017
@vors vors removed the question The issue is a question. label Jan 27, 2017
@MagicMarty
Copy link

Hi,
Can anyone help me with the following? Getting the following with 8.1.0.0 module while. Any hints?

VM has reported a failure when processing extension 'Microsoft.Powershell.DSC'. Error message: \"DSC Configuration 'Main' completed with error(s). Following are the first few: PowerShell DSC resource MSFT_xSQLServerSetup failed to execute Set-TargetResource functionality with error message: System.Exception: Test-TargetResource returned false after calling Set-TargetResource. The SendConfigurationApply function did not succeed.\"

xSQLServerSetup 'InstallDefaultInstance'
{
InstanceName = 'elasta'
#Features = 'SQLENGINE'
SQLCollation = 'SQL_Latin1_General_CP1_CI_AS'
#[PSCredential] SQLSvcAccount (Write): Service account for the SQL service.
SQLSvcAccount = $SqlInstallCredential
#[PSCredential] AgtSvcAccount (Write): Service account for the SQL Agent service.
AgtSvcAccount = $SqlInstallCredential
#[String[]] SQLSysAdminAccounts (Write): Array of accounts to be made SQL administrators.
SQLSysAdminAccounts = $SqlInstallCredential.UserName
ASSvcAccount = $SqlInstallCredential
ASSysAdminAccounts = $SqlInstallCredential.UserName
InstallSharedDir = 'C:\Program Files\Microsoft SQL Server'
InstallSharedWOWDir = 'C:\Program Files (x86)\Microsoft SQL Server'
InstanceDir = 'C:\Program Files\Microsoft SQL Server'
InstallSQLDataDir = 'M:\SQLData'
SQLUserDBDir = 'M:\SQLData'
SQLUserDBLogDir = 'L:\SQLLogs'
SQLTempDBDir = 'D:'
SQLTempDBLogDir = 'D:'
SQLBackupDir = 'U:\Utilities'
SourcePath = 'C:\SQLServerFull'
UpdateEnabled = 'False'
ForceReboot = $false
PsDscRunAsCredential = $SqlInstallCredential
DependsOn = '[WindowsFeature]NetFramework35', '[WindowsFeature]NetFramework45', '[File]FolderG', '[File]FolderL', '[File]FolderM', '[File]FolderT', '[File]FolderU'
}

Thanks!

@gdbarron
Copy link

@MagicMarty From what I've seen, this typically means the setup finished, but not successfully. Have a look at the sql install log which can found at a path similar to "C:\Program Files\Microsoft SQL Server\130\Setup Bootstrap\Log\Summary.txt". (this one is for sql 2016)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug.
Projects
None yet
Development

No branches or pull requests

8 participants