Without getting too technical (just yet) let me try and explain what I am doing. I am just about done with a script that installs a 2 node cluster on Server 2008, creates resources and then installs SQL server 2008.
The SQL server install portion uses a configuration file to install on the first node. After which I have Powershell copy another required .ini file to the second node. My plan is then to remote execute the SQL setup.exe on the second node using the ini file I just copied there.
This is the last step in my script and I'm stumped. I tired using WMI to execute the command like this.....
--------------------------------------------
#Install SQL onto Node 2
$strRemoteSQlconfigFile = $strSQLPath + "\config_add_node2.ini"
$strCMD = $strSQLPath + "setup.exe /ConfigurationFile=" + $strRemoteSQlconfigFile
Write-Host “Installing software on $strNode2”
Copy-Item ($strCurrentPath + "\SQL\config_add_node2.ini") ("\\" + $strNode2 + "\" + $strSQLPath.Replace(":","$"))
$Process = ([WMICLASS]“\\$strNode2\ROOT\CIMV2:win32_process”)
$Remote = $Process.Create(“cmd.exe /c $strCMD”)
If ($Remote.returnvalue -eq 0) {
Write-Host "Successfully launched $cmd on $computername with a process id of" $Remote.processid -ForegroundColor GREEN
}
else {
Write-Host "Failed to launch $strCmd on $strNode1. ReturnValue is" $Remote.ReturnValue -ForegroundColor RED
--------------------------------------------------------------
The above works just fine however when I look at the second node where the process started I see it failed right away. In the SQL install log I see this entry....
Message:
There was an error generating the XML document.
Data:
DisableWatson = true
Stack:
at Microsoft.SqlServer.Chainer.Infrastructure.DataStoreService.SerializeObject(String rootPath, Object objectToSerialize, Boolean saveToCache)
at Microsoft.SqlServer.Chainer.Infrastructure.DataStoreService.SerializeObject(Object objectToSerialize)
at Microsoft.SqlServer.Chainer.Infrastructure.InputSettingService.SaveInputSettingValueToObject(InputSettingInfo inputSettingInfo, List`1 values)
at Microsoft.SqlServer.Chainer.Infrastructure.InputSettingService.SaveParsedArgumentsIntoInputSettingStore(InputSettingSource source, Dictionary`2 parsedArguments, Boolean chainerSetting, Boolean ignoreSettingsForNotAllowedScnearios)
at Microsoft.SqlServer.Chainer.Infrastructure.InputSettingService.ProcessConfigFile(String configFileFullPath, Boolean chainerSetting, Boolean ignoreSettingsForNotAllowedScnearios)
at Microsoft.SqlServer.Configuration.BootstrapExtension.ProcessConfigFileArguments.ExecuteAction(String actionId)
at Microsoft.SqlServer.Chainer.Infrastructure.Action.Execute(String actionId, TextWriter errorStream)
at Microsoft.SqlServer.Setup.Chainer.Workflow.ActionInvocation.ExecuteActionHelper(TextWriter statusStream, ISequencedAction actionToRun)
Inner exception type: System.InvalidOperationException
at System.Xml.Serialization.XmlSerializer.Serialize(XmlWriter xmlWriter, Object o, XmlSerializerNamespaces namespaces, String encodingStyle, String id)
at System.Xml.Serialization.XmlSerializer.Serialize(TextWriter textWriter, Object o)
Inner exception type: System.Security.Cryptography.CryptographicException
The requested operation cannot be completed. The computer must be trusted for delegation and the current user account must be configured to allow delegation.
I also tried doing a quick test and broke the install out into a separate script and used invoke-command -computername srvname {c:\somelocation\scriptname.ps1}
but I get the same results. I understand that the second node is having issues with either my user ID or the computer from which I am executing the command from but I'm not sure how to solve this. My user ID is part of domain admin group and I can't change too many things in the environment to get this to work because once the script is done it will be used globally in different offices to install cluster / SQL / and an application. The idea is for the local SAs to have to do as little as possible to get this rolled out.
Sorry for being long winded, any help would be much appreciated!!
If I understand correctly you are:
This will not work.
You have tripped over the double hop problem in that you cannot delegate your credentials from a remote machine to a second remote machine.
You have a couple of options: