Powershell DSC Pull Server 引发内部错误 - 未找到 Microsoft.Isam.Esent.Interop [英] Powershell DSC Pull Server throws internal error - Microsoft.Isam.Esent.Interop not found

查看:61
本文介绍了Powershell DSC Pull Server 引发内部错误 - 未找到 Microsoft.Isam.Esent.Interop的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已按照 Powershell.org 的 DSC Book 中的说明设置 http Pull与 DSC 一起使用的服务器(Windows 2012 服务器).我设置了 http 拉取服务器,然后制作了一个要拉取的配置,然后设置我节点的 LCM 来拉取和运行配置.

I've followed the instructions found in Powershell.org's DSC Book to set up an http Pull Server (Windows 2012 server) to use with DSC. I set up the http Pull Server, then crafted a configuration to be pulled, then set up my node's LCM to pull and run the configuration.

我可以在 Task Scheduler/Microsoft/Windows/Desired State Configuration 下的节点上看到一个计划任务,所以我知道至少某些东西有效.但是,我的配置没有运行.当我查看 Apps&Svcs/Microsoft/Windows/Desired State Configuration/Operational Log 下的事件日志时,我看到以下事件:

I can see a Scheduled task on the node under Task Scheduler/Microsoft/Windows/Desired State Configuration, so I know at least something worked. However, my configuration is not being run. When I look at the Event Logs under Apps&Svcs/Microsoft/Windows/Desired State Configuration/Operational Log, I see the following event:

Job {E0B6977A-E34F-4EDD-8455-E555063CD3DD} : 
This event indicates that failure happens when LCM is trying to get the configuration from pull server using download manager WebDownloadManager. ErrorId is 0x1. ErrorDetail is The attempt to get the action from server http://pullserver.local:8080/PSDSCPullServer/Action(ConfigurationId='adaba4f6-b2b6-420d-a1dd-3714106451d6')/GetAction returned unexpected response code InternalServerError.

当我手动点击该 URL 时,启用 CustomErrors 后,出现以下错误:

When I manually hit that URL, after enabling CustomErrors, here is the error:

Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Isam.Esent.Interop, Version=6.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

我尝试在谷歌上搜索此错误(运气不佳),但找不到有关此 DLL 的有用信息.看起来它应该与 Windows 的某些部分一起提供,但我在我的系统上没有看到它.我不愿意从这些DLL 下载器"站点之一下载它.

I tried googling for this error (no luck) and I can't find helpful information on this DLL. It looks like it's supposed to come with some parts of Windows, but I don't see it on my system. I'm reluctant to download it from one of those "DLL Downloader" sites.

知道为什么 DSC Pull Server 似乎需要这个 DLL 而我没有吗?

Any ideas why the DSC Pull Server seems to require this DLL and I don't have it?

推荐答案

似乎 xPSDesiredStateConfiguration 中的 PSDSCPullServer 资源默认使用 Esent 作为数据库提供程序,它仅适用于 Windows 8.1(不适用于 Server 2012).我在此处找到了一些文档,其中包含一些代码我可以复制.我只需要为我的拉取服务器编辑 web.config 并更改它:

It seems that the PSDSCPullServer resource out of xPSDesiredStateConfiguration defaults to using Esent as a database provider, which only works with Windows 8.1 (not Server 2012). I found some documentation here with some code I could copy. I just had to edit the web.config for my pull server and change this:

<add key="dbprovider" value="ESENT" />
<add key="dbconnectionstr" value="C:\Program Files\WindowsPowerShell\DscService\Devices.edb" />

这样:

<add key="dbprovider" value="System.Data.OleDb" />
<add key="dbconnectionstr" value="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program Files\WindowsPowerShell\DscService\Devices.mdb;"/>

原始配置试图指向 Devices.edb(在我的系统中不存在,.mdb 存在)这一事实进一步证明发生了一些奇怪的事情.

The fact that the original configuration tried to point to a Devices.edb (which did not exist on my system, .mdb did) is further evidence that something funky was going on.

这篇关于Powershell DSC Pull Server 引发内部错误 - 未找到 Microsoft.Isam.Esent.Interop的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆