Jay*_*ang 2 windows powershell dsc
我按照Powershell.org的DSC Book中的说明设置了一个用于DSC的http Pull服务器(Windows 2012服务器).我设置了http Pull Server,然后设计了一个要拉的配置,然后设置我的节点的LCM以拉动并运行配置.
我可以在任务计划程序/ Microsoft/Windows /所需状态配置下的节点上看到计划任务,所以我知道至少有些工作.但是,我的配置没有运行.当我查看Apps&Svcs/Microsoft/Windows/Desired State Configuration/Operational Log下的Event Logs时,我看到以下事件:
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.
Run Code Online (Sandbox Code Playgroud)
当我手动点击该URL时,启用CustomErrors后,出现以下错误:
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.
Run Code Online (Sandbox Code Playgroud)
我试图谷歌搜索这个错误(没有运气),我找不到有关此DLL的有用信息.看起来它应该与Windows的某些部分一起出现,但我在我的系统上看不到它.我不愿意从其中一个"DLL Downloader"站点下载它.
任何想法为什么DSC拉服务器似乎需要这个DLL,我没有它?
似乎xPSDesiredStateConfiguration中的PSDSCPullServer资源默认使用Esent作为数据库提供程序,该程序仅适用于Windows 8.1(不是Server 2012).我在这里找到了一些文档和一些我可以复制的代码.我只需编辑我的拉服务器的web.config并更改它:
<add key="dbprovider" value="ESENT" />
<add key="dbconnectionstr" value="C:\Program Files\WindowsPowerShell\DscService\Devices.edb" />
Run Code Online (Sandbox Code Playgroud)
有了这个:
<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;"/>
Run Code Online (Sandbox Code Playgroud)
原始配置试图指向Devices.edb(我的系统上不存在,.mdb确实存在)这一事实进一步证明了一些时髦的事情正在发生.