Closed kamellemann closed 1 month ago
Running as user Running as system
Hi, Thanks for the report, i found the issue and i'm going to fix it in version 0.6.8 which is coming out very soon.
The problem is that the method LocalUserRetriever.Get()
doesn't include SYSTEM in the returned users list, in this line.
by the way, do you have a specific requirement to run the module as SYSTEM?
Hi, great, thank´s for the fast feedback. We are running this script in AVD as custom compliance script via intune.
I´ve modified the files you have changed on my system and all fine now:
I just need to comment these lines out
But those are related to toast notification, the problem with running the module as SYSTEM was that its SID is a well-known one and not like other user accounts which i fixed and will release new update today. With that change i can run the module on my device as SYSTEM too using PSexec.
Yepp, i´ve modified globalvars as well, but without having this line commented out, i got an error. But seems to be related to my manual modification :-)
Just released version 0.6.8, if you run any of the functions it will auto update to the latest version, or you can update it manually if you like.
Here is the release notes: https://github.com/HotCakeX/Harden-Windows-Security/releases/tag/Hardening-Module-v.0.6.8
Thanks again for reporting :)
Tools category
Harden Windows Security Module
Does Your System Meet The Requirements?
Is your Windows Installation Genuine?
Did You Read The Frequently Asked Questions?
Please Explain The Bug
Starting with Windows 24H2, Hardening Module will no longer work as system. All fine when running as normal user. Error: ParentContainsErrorRecordException: Exception setting "Host": "The type initializer for 'HardenWindowsSecurity.GlobalVars' threw an exception." Import-Module: The module to process 'Harden-Windows-Security-Module.psm1', listed in field 'ModuleToProcess/RootModule' of module manifest 'C:\Hardening\Harden-Windows-Security-Module\0.6.7\Harden-Windows-Security-Module.psd1' was not processed because no valid module was found in any module directory.
Name Value
PSVersion 7.4.6 PSEdition Core GitCommitId 7.4.6 OS Microsoft Windows 10.0.26100 Platform Win32NT PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…} PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1 WSManStackVersion 3.0
Error Details