-
Notifications
You must be signed in to change notification settings - Fork 225
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
DSC PowerShell MSFT_xSQLServerScript error on Test-TargetResource #252
Comments
I will look into this after Christmas, unless someone else have had time to help you with this. 😄 |
I think I see the problem. In the parameter
Please let me know if this helped, otherwise I dig in further. |
Hi @johlju . I'm even trying with the Script Resource to execute "invoke-sqlcmd" but is not working either. I have a similar error. Any ideas?
|
What are |
exactly: 'serverXX\instance'. |
Okay, thank you. I'm gonna test your config in my lab. See why/what are failing. 😄 |
@emitodiaz I got the same error. If I run this row by row directly on the server I get a error message saying 'Login failed...'. It seems by adding parameter
What it does not say is that If the parameter is left out (or set to So there are two thing we need to fix (I will submit a new issue for this)
If you actually want to use SQL Authentication, then this is not the issue. Then I have to dig further. 😄 |
@emitodiaz Above I wrote that I got the same error, that is not entirely correct. I got the following error when trying to use SQL Authentication.
When removing |
The error you are getting:
Translated to English:
This is very strange. Could you run this directly on the server? Do you get any errors?
|
By the way, I also tried with the Script Resource (not using xSQLServer), executing directly invoke-sqlCmd and I get the same error `El recurso de DSC de PowerShell MSFT_ScriptResource no pudo ejecutar la funcionalidad de Set-TargetResource con el mensaje de error: El ensamblado de modo mixto se ha compilado con la El servicio WS-Management no puede procesar la solicitud. El servicio WMI o el proveedor de WMI devolvió un error desconocido: HRESULT 0x800706be Maybe something with SQLPS module? (I'm using the one inside Microsoft® SQL Server® 2016 Feature Pack) |
I set up a new server with Windows Server 2012 R2 (English), SQL Server 2014 and PowerShell 4.0. Using SQLPS from SQL Server 2014. Running the following configuration xSQLServerScript 'SQL2014-RunSQLScript'
{
ServerInstance = 'sqltest3.company.local\SQL2014'
SetFilePath = 'C:\DSCTemp\SQLScripts\Set-RunSQLScript.sql'
TestFilePath = 'C:\DSCTemp\SQLScripts\Test-RunSQLScript.sql'
GetFilePath = 'C:\DSCTemp\SQLScripts\Get-RunSQLScript.sql'
} I got these errors:
I tested to execute the resource functions manually directly from PowerShell prompt (ISE). That worked without any problem, so that rules out problems using the SQLPS-module with PowerShell 4.0. After installing PowerShell 5.0 everything works as expected
As of this time I have no solution how to use |
@johlju - I haven't run into anything like this before unfortunately. But there are lot of different behaviors with the LCM between WMF 4.0 and WMF 5.0. If in doubt, upgrade to WMF5.0 is our general solution to this sort of thing. Sorry I can't be of more assitance. 😢 |
@emitodiaz I'm sorry we can't solve this one for you. Could you try installing PowerShell 5.0 and verify that it works for you? @PlagueHO Thanks for taking the time to look at this! You helped! Now I know this probably isn't some basic error. I did more testing yesterday and came up short again. To know whats going on here I would need more knowledge, so I have to put this on the "unsolvable today" pile for now. 😞 |
Always a pleasure @johlju ! I do hate having to put things on the unsolvable pile too as well. But if WMF 5.0 is a solution to a problem 😁 ... |
Hi!, sorry for the delay. |
@emitodiaz Glad to hear it! Happy to help. Closing this issue. Thanks! |
Hi, I'm trying the xSQLServerScript and I don't know if it's an error or I'm making a mistake calling the resource.
Thanks in advance, Emiliano.
Error:
DEPURACIÓN: [SERVER26]: [[xSQLServerScript]SqlSettings] SQLPS module imported. DEPURACIÓN: [SERVER26]: [[xSQLServerScript]SqlSettings] Popping location back to what it was before importing SQLPS module. DETALLADO: [SERVER26]: LCM: [ FinalizarProbar ] [[xSQLServerScript]SqlSettings] en 0.5780 segundos. El recurso de DSC de PowerShell MSFT_xSQLServerScript generó uno o más errores de no terminación al ejecutar la funcionalidad de Test-TargetResource. Estos errores se registran en el canal ETW llamado Microsoft-Windows-DSC/operativo. Consulte este canal para obtener más detalles. + CategoryInfo : InvalidOperation: (:) [], CimException + FullyQualifiedErrorId : NonTerminatingErrorFromProvider
Details
`Powershell version on Windows 2012 R2, 64 BITS, Spanish.
PSVersion 4.0
WSManStackVersion 3.0
SerializationVersion 1.1.0.1
CLRVersion 4.0.30319.36366
BuildVersion 6.3.9600.17400
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0}
PSRemotingProtocolVersion 2.2
Module: xSQLServer versión: 4.0.0.0
`
PS C:\Windows\system32> Start-DscConfiguration -Path "E:\DSC Resources" -Wait -Verbose -Force -Debug
DETALLADO: Realice la operación 'Invocar método de CIM' con los parámetros siguientes, ''methodName' = SendConfigurationApply,'className' = MSFT_DSCLocalConfigurationManager,'namespaceName' =
root/Microsoft/Windows/DesiredStateConfiguration'.
DETALLADO: Se recibió una llamada de método de LCM desde el equipo DES001 con el SID de usuario S-1-5-21-3370056077-3368664693-1737765451-1238.
DETALLADO: [SERVER26]: LCM: [ IniciarEstablecer]
DETALLADO: [SERVER26]: LCM: [ IniciarRecurso ] [[xSQLServerScript]SqlSettings]
DETALLADO: [SERVER26]: LCM: [ IniciarProbar ] [[xSQLServerScript]SqlSettings]
DEPURACIÓN: [SERVER26]: [[xSQLServerScript]SqlSettings] Unloading SQLPS module.
DEPURACIÓN: [SERVER26]: [[xSQLServerScript]SqlSettings] SQLPS module changes CWD to SQLSERVER:\ when loading, pushing location to pop it when module is loaded.
DETALLADO: [SERVER26]: [[xSQLServerScript]SqlSettings] 2016-12-21_13-12-54: Importing SQLPS module.
DEPURACIÓN: [SERVER26]: [[xSQLServerScript]SqlSettings] Called Initialization method
DEPURACIÓN: [SERVER26]: [[xSQLServerScript]SqlSettings] Starting extension DAC
DEPURACIÓN: [SERVER26]: [[xSQLServerScript]SqlSettings] Starting extension DataCollection
DEPURACIÓN: [SERVER26]: [[xSQLServerScript]SqlSettings] Starting extension SQLPolicy
DEPURACIÓN: [SERVER26]: [[xSQLServerScript]SqlSettings] Starting extension Utility
DEPURACIÓN: [SERVER26]: [[xSQLServerScript]SqlSettings] Starting extension SQLRegistration
DEPURACIÓN: [SERVER26]: [[xSQLServerScript]SqlSettings] Starting extension SQLSERVER
DEPURACIÓN: [SERVER26]: [[xSQLServerScript]SqlSettings] Starting extension SQL
DEPURACIÓN: [SERVER26]: [[xSQLServerScript]SqlSettings] Starting extension SSIS
DEPURACIÓN: [SERVER26]: [[xSQLServerScript]SqlSettings] Starting extension XEvent
DEPURACIÓN: [SERVER26]: [[xSQLServerScript]SqlSettings] Starting extension DatabaseXEvent
DEPURACIÓN: [SERVER26]: [[xSQLServerScript]SqlSettings] Starting extension SQLAS
DEPURACIÓN: [SERVER26]: [[xSQLServerScript]SqlSettings] ItemExists: SQLSERVER:
DEPURACIÓN: [SERVER26]: [[xSQLServerScript]SqlSettings] ItemExists: SQLSERVER:
DEPURACIÓN: [SERVER26]: [[xSQLServerScript]SqlSettings] SQLPS module imported.
DEPURACIÓN: [SERVER26]: [[xSQLServerScript]SqlSettings] Popping location back to what it was before importing SQLPS module.
DETALLADO: [SERVER26]: LCM: [ FinalizarProbar ] [[xSQLServerScript]SqlSettings] en 0.5780 segundos.
El recurso de DSC de PowerShell MSFT_xSQLServerScript generó uno o más errores de no terminación al ejecutar la funcionalidad de Test-TargetResource. Estos errores se registran en el canal
ETW llamado Microsoft-Windows-DSC/operativo. Consulte este canal para obtener más detalles.
+ CategoryInfo : InvalidOperation: (:) [], CimException
+ FullyQualifiedErrorId : NonTerminatingErrorFromProvider
+ PSComputerName : SERVER26
La función SendConfigurationApply no se completó correctamente.
+ CategoryInfo : NotSpecified: (root/Microsoft/...gurationManager:String) [], CimException
+ FullyQualifiedErrorId : MI RESULT 1
+ PSComputerName : SERVER26
DETALLADO: La operación 'Invocar método de CIM' se completó.
DETALLADO: El tiempo que tarda el trabajo de configuración en completarse es de 0.688 segundos
On the EventViewer I see the next two errors:
`Trabajo {43D6E94B-C7AB-11E6-80D1-00155D03053C}:
Este evento indica que se generó un error de no terminación cuando DSCEngine ejecutaba Test-TargetResource en el recurso de DSC MSFT_xSQLServerScript. FullyQualifiedErrorId: System.IO.FileLoadException,Microsoft.SqlServer.Management.PowerShell.GetScriptCommand. ErrorMessage: El ensamblado de modo mixto se ha compilado con la versión 'v2.0.50727' del runtime y no se puede cargar en el runtime 4.0 sin información de configuración adicional..
Trabajo {43D6E94B-C7AB-11E6-80D1-00155D03053C}:
Este evento indica un error cuando LCM procesa la configuración. ErrorId: 0x1. ErrorDetail: La función SendConfigurationApply no se completó correctamente.. ResourceId: [xSQLServerScript]SqlSettings. SourceInfo: ::14::9::xSQLServerScript. ErrorMessage: El recurso de DSC de PowerShell MSFT_xSQLServerScript generó uno o más errores de no terminación al ejecutar la funcionalidad de Test-TargetResource. Estos errores se registran en el canal ETW llamado Microsoft-Windows-DSC/operativo. Consulte este canal para obtener más detalles..
`
My testing script:
`configuration SQLSettings
{
param
(
[Parameter(Mandatory=$false)]
[ValidateNotNullorEmpty()]
[PsCredential] $CredencialUSR
)
}
$configData = @{
AllNodes = @(
@{
NodeName = 'SERVER26'
InstanceName = 'SERVER26\SQL2014SE'
PsDscAllowPlainTextPassword= $true
PSDscAllowDomainUser = $true
}
)
}
SQLSettings -ConfigurationData $configData -OutputPath "E:\DSC Resources" -CredencialUSR $cred`
The text was updated successfully, but these errors were encountered: