How to fix Could not load file or assembly Microsoft.Isam.Esent.Interop error when you setup PowerShell DSC HTTPS Pull Server

I have just downloaded DSC Resource Kit Wave 10 and I can see that known error when you setup PowerShell Desired State Configuration (DSC) HTTP Pull Server was not fixed yet. The reason is that the resource kit is February release. The error is related to missing Microsoft.Isam.Esent.Interop assembly that is available on Windows 8.1 but not on Windows Server 2012 R2.

There are several possibilities how to fix the issue.

  1. You can download current xPSDesiredStateConfiguration from Github.
  2. You can download it using PackageManagement (OneGet).
  3. Or you can fix it using PowerShell. The only thing you need to do is replace two lines of text:
$path = 'C:\inetpub\wwwroot\PSDSCPullServer\web.config'

$content = Get-Content -Path $path | ForEach-Object -Process `
Replace('<add key="dbprovider" value="ESENT" />',
        '<add key="dbprovider" value="System.Data.OleDb" />').
        Replace('<add key="dbconnectionstr" value="C:\Program Files\WindowsPowerShell\DscService\Devices.edb" />',
        '<add key="dbconnectionstr" value="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program Files\WindowsPowerShell\DscService\Devices.mdb;" />') } $content | Set-Content -Path $path -Encoding UTF8

Leave a Reply

Your email address will not be published.