Group Policy Module not loading in memory

Ask your PowerShell-related questions, including questions on cmdlet development!
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Posts: 1
Last visit: Thu Jan 13, 2022 12:39 am

Group Policy Module not loading in memory

Post by scarlson »

I have built an exe using the V3 script engine and when it runs on windows 2008 servers the
group policy module will not load even though the server has Powershell V5.

Its odd as I can execute the cmdlets for group policy fine in the shell but when using the exe
it won't, please see the screenshots attached.
errors for tool.png
errors for tool.png (48.6 KiB) Viewed 3015 times
Posts: 15037
Last visit: Fri Jan 14, 2022 2:16 pm
Answers: 16
Has voted: 3 times
Been upvoted: 13 times

Re: Group Policy Module not loading in memory

Post by jvierra »

The first thing to consider is that WS2008 has been obsolete and unsupported for years. The GP CmdLets no longer match the WS2008 API level.

While V5 will run on any version of Windows the modules won't. The GP Module was built fro a later version of Windows Server and teh GP subsystem was changed many times before the GP modules.

I recommend upgrading your server to a supported version which would be any version later than 2012.

I can also recommend playing with the "host" you are using for the EXE as sometimes some GPO CmdLets might work with different "host" implementations.

Also, you note that you are claiming a V3 build and saying the server has V5. I would suspect that a V3 build might have issues if the server only has V5 installed. Remember that no matter how you build an EXE it is still dependent on the PowerShell host version.
User avatar
Alexander Riedel
Posts: 7851
Last visit: Fri Jan 14, 2022 9:40 am
Answers: 10
Been upvoted: 15 times

Re: Group Policy Module not loading in memory

Post by Alexander Riedel »

I am somewhat curious what made you choose a V3 engine if your machine runs V5. Would you please elaborate?
Alexander Riedel
SAPIEN Technologies, Inc.