raandree / NTFSSecurity

Managing permissions with PowerShell is only a bit easier than in VBS or the command line as there are no cmdlets for most day-to-day tasks like getting a permission report or adding permission to an item. PowerShell only offers Get-Acl and Set-Acl but everything in between getting and setting the ACL is missing. This module closes the gap.
MIT License
431 stars 61 forks source link

Error Import -module NTFSSecurity #80

Closed Landris18 closed 2 years ago

Landris18 commented 2 years ago

This error happens when i Try to import the module on Windows server 2012 R2 and powershell v5

I downloaded it from https://github.com/raandree/NTFSSecurity/releases/tag/4.2.3

`PS Z:> Import-Module NTFSSecurity Add-Type : Could not load file or assembly 'file://\fs\PowerShellModules\NTFSSecurity\Security2.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515) At \fs\PowerShellModules\NTFSSecurity\NTFSSecurity.Init.ps1:141 char:1

Add-Type : Could not load file or assembly 'file://\fs\PowerShellModules\NTFSSecurity\PrivilegeControl.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515) At \fs\PowerShellModules\NTFSSecurity\NTFSSecurity.Init.ps1:142 char:1

Add-Type : Could not load file or assembly 'file://\fs\PowerShellModules\NTFSSecurity\ProcessPrivileges.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515) At \fs\PowerShellModules\NTFSSecurity\NTFSSecurity.Init.ps1:143 char:1

Types added NTFSSecurity Module loaded Import-Module : Unable to find type [Security2.IdentityReference2]: make sure that the assembly containing this type is loaded. At line:1 char:1

Landris18 commented 2 years ago

I found the solution on windows 2012 r2: You must unblock all dll file in NTFSSecurity folder. Right click -> Properties -> Unblock