Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

How to sign standard Powershell modules ?

$
0
0

Hello,

I'm working in an environment where ExecutionPolicy on all the servers is set to "AllSigned", I need to run scripts automatically that use cmdlets from some of the modules like ActiveDirectory and it's needed to import these modules at the beginning of the script. While the script itself works perfectly fine after being signed but the import-module at the beginning fails with this error :

The following error occurred while loading the extended type data file:
Microsoft.PowerShell, C:\Windows\system32\WindowsPowerShell\v1.0\Modules\activedirectory\ActiveDirectory.Types.ps1xml : File skipped because of the following validation exception: FileC:\Windows\system32\WindowsPowerShell\v1.0\Modules\activedirectory\ActiveDirectory.Types.ps1xml cannot be loaded. The fileC:\Windows\system32\WindowsPowerShell\v1.0\Modules\activedirectory\ActiveDirectory.Types.ps1xml is not digitally signed. The script will not execute on the system

I have tried to sign the file but the access to this file is restricted and I don't want to change permissions. Has anybody else faced this problem or has a suggestion how to import modules in an environment where ExecutionPolicy is set to AllSigned.

Thanks a lot.


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>