java sql server 2012,适用于Windows Server 2012和SQL Server 2014

博主在使用Ansible通过WinRM管理Windows服务器时,遇到从PowerShell脚本运行exe文件失败的问题。尽管作为管理员,安装SQL Server时仍遭遇AccessDenied错误及XML文档生成错误。寻求协助以解决权限设置和脚本执行问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

我实际上在superUser上发布了这个问题,但我认为它可能在错误的地方 . 我很抱歉 .

我一直在使用ansible和WinRM来管理Windows服务器,并且使用它来运行基本命令略有成功 .

但是,当我尝试从powershell脚本中运行exe文件时,它会失败 .

当我直接从Windows运行时,它运行完全没有任何错误 . 它抛出的唯一错误是一个Access Denied错误,它会链接到权限,但是作为管理员,它应该具有完全权限吗?

我尝试运行的powershell脚本是:

Write-Host "Installing SQL Server"

C:\software-downloads\SQL\setup.exe /ConfigurationFile=C:\software-downloads\ConfigurationFile.ini

Ansible抛出的错误是:

The following error occurred:

There was an error generating the XML document.

Error result: -2068774911

Result facility code: 1201

Result error code: 1

Please review the summary.txt log for further details

并查看它显示的摘要日志文件:

Overall summary:

Final result: Failed: see details below

Exit code (Decimal): -2068774911

Exit facility code: 1201

Exit error code: 1

Exit message: There was an error generating the XML document.

Start time: 2016-06-24 06:47:55

End time: 2016-06-24 06:48:15

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.4100.1&EvtType=0xE0C083E6%400xF80B8030&EvtType=0xE0C083E6%400xF80B8030

Exception summary:

The following is an exception stack listing the exceptions in outermost to innermost order

Inner exceptions are being indented

Exception type: Microsoft.SqlServer.Chainer.Infrastructure.ChainerInfrastructureException

Message:

There was an error generating the XML document.

HResult : 0x84b10001

FacilityCode : 1201 (4b1)

ErrorCode : 1 (0001)

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.CalculateSettings(IEnumerable`1 settingIds)

at Microsoft.SqlServer.Chainer.Infrastructure.InputSettingService.CalculateAllSettings(Boolean chainerSettingOnly)

at Microsoft.SqlServer.Configuration.SetupExtension.FinalCalculateSettingsAction.ExecuteAction(String actionId)

at Microsoft.SqlServer.Chainer.Infrastructure.Action.Execute(String actionId, TextWriter errorStream)

at Microsoft.SqlServer.Setup.Chainer.Workflow.ActionInvocation.<>c__DisplayClasse.b__b()

at Microsoft.SqlServer.Setup.Chainer.Workflow.ActionInvocation.ExecuteActionHelper(ActionWorker workerDelegate)

Inner exception type: System.InvalidOperationException

Message:

There was an error generating the XML document.

HResult : 0x80131509

Stack:

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)

at Microsoft.SqlServer.Chainer.Infrastructure.DataStoreService.SerializeObject(String rootPath, Object objectToSerialize, Boolean saveToCache)

Inner exception type: System.Security.Cryptography.CryptographicException

Message:

Access is denied.

HResult : 0x80070005

Stack:

at System.Security.Cryptography.ProtectedData.Protect(Byte[] userData, Byte[] optionalEntropy, DataProtectionScope scope)

at Microsoft.SqlServer.Common.SqlSecureString.WriteXml(XmlWriter writer)

at System.Xml.Serialization.XmlSerializationWriter.WriteSerializable(IXmlSerializable serializable, String name, String ns, Boolean isNullable, Boolean wrapped)

at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterAgentConfigurationPublic.Write6_AgentConfigurationPublic(String n, String ns, AgentConfigurationPublic o, Boolean isNullable, Boolean needType)

at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterAgentConfigurationPublic.Write7_AgentConfigurationPublic(Object o)

当我点击它时,异常帮助链接不会去任何地方 .

我尝试使用启动进程传递凭据,但这不起作用,因为我可能使用它错误,因为我必须作为参数传递配置文件 .

我知道它运行正常,因为我可以运行其他脚本,包括从S3下载文件和自动加入域 .

有没有人通过ansible在Windows中成功安装了exe文件?任何帮助都会很棒,因为我甚至可能过度简单了?

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值