MichaelGrafnetter / DSInternals

Directory Services Internals (DSInternals) PowerShell Module and Framework
https://www.dsinternals.com
MIT License
1.65k stars 254 forks source link

Cannot Import Version 4.3 #108

Closed Hamsterfisch closed 4 years ago

Hamsterfisch commented 4 years ago

Hello,

I installed Version 4.3 on Windows Server 2016 and Windows Server 2012 R2. Errormessage: Import-Module: Could not load file or assembly \dsinternals.common.dll or one of its dependencies (HRESULT: 0x80131515) PowerShell Version: 5.1.14393.2636

best regards!

MichaelGrafnetter commented 4 years ago

Hi @Hamsterfisch

I just deployed a clean Windows Server 2016 1607 computer and DSInternals 4.3 from GitHub ran there without any issues. On a new Windows Server 2012 R2 computer, I only needed to update the .NET Framework and install the Universal C Runtime, but it then also ran without any issues. And these components even get installed automatically when Windows Update is enabled.

How did you download the module? Could you please post the exact parameters of Import-Module that you are calling it with? See Submitting Bug Reports.

Hamsterfisch commented 4 years ago

Hi,

thanks for your reply.

I followed thesese instructions for installing: https://github.com/MichaelGrafnetter/DSInternals#downloads

First, I tried to install the module like this: dsinternals I also tried (Same Errormessage): Install-Module DSInternals Install-Module DSInternals -RequiredVersion 4.2

Because I could not download it like this, I downloaded the zip file and extracted it into C:\Windows\system32\WindowsPowerShell\v1.0\Modules\

For importing, I followed this example: https://www.dsinternals.com/en/retrieving-active-directory-passwords-remotely/ I also tried import-module dsinterals -force

MichaelGrafnetter commented 4 years ago

You apparently have 2 different issues here.

If you are not able to download packages, check your internet connectivity, including proxy configuration, and TLS settings. The following command helps in some cases:

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

But local installation should work under all circumstances. Are you sure that you followed the instructions? I was able to replicate the HRESULT: 0x80131515 error by not unblocking the ZIP file first. You can try to to this to fix it:

Get-ChildItem C:\Windows\system32\WindowsPowerShell\v1.0\Modules\ -Recurse -File | Unblock-File
Import-Module DSInternals

If you tried to import the module before unblocking the files, you need to open a new PowerShell console.