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.
This topic is 2 years and 6 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
scarlson
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.
Attachments
errors for tool.png
errors for tool.png (48.6 KiB) Viewed 4317 times
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 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: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 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.
This topic is 2 years and 6 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked