Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Caused by 3rd party security solution] "WMI query for 'MSFT_MpPreference' failed: Generic Fail " #541

Closed
altasnet opened this issue Jan 17, 2025 · 3 comments
Labels
Need more info The user needs to provide more info.

Comments

@altasnet
Copy link

I've just tryed to install and I get this error bellow and I couldnt find anything about it in the docs.

PowerShell 7.4.6
PS C:\Windows\System32> Protect-WindowsSecurity -GUI
17/01/2025 11:03:10: Could not find UserName or FullName of the current user with the SID S-X-X-XX-XXXXXXX-XXXXXX-XXXXXXX-XXXX
Protect-WindowsSecurity: Exception calling "Initialize" with "1" argument(s): "WMI query for 'MSFT_MpPreference' failed: Falha genérica "

@HotCakeX
Copy link
Owner

What kind of user account do you have? Local/Online (Microsoft account)/ EntraID/ Domain account.
Tell me more about your environment. Have you installed any 3rd party security solution?

@HotCakeX HotCakeX added the Need more info The user needs to provide more info. label Jan 17, 2025
@altasnet
Copy link
Author

Windows 11 with local domain that is in sync with EntraID. Yes we have 3rd party security solutions but I have configured exceptions to allow this script to run. There is no block in 3rd party security product.

In the same powershell window if I run "Get-WMIObject -class Win32_ComputerSystem | select -ExpandProperty username" I can get the Domain\username logged in windows.

@HotCakeX
Copy link
Owner

HotCakeX commented Jan 17, 2025

Thanks, so the thing about user account is simply a logged message, it's not a terminating error and it doesn't cause issues, but i'll try to reproduce it on my end to fix it.

What you actually got an error for is when the module tries to query the Defender preferences using CIM instance which is almost the same as Get-MpPreference. I can't do anything about it because the module is just doing standard procedure. If you try it on a clean VM you will see it works, so you have to find the cause of the issue on your end.

With a high degree of certainty i can tell it's caused by the 3rd party security solution which is in the requirements of the module to not exist. (it is mentioned on the readme and FAQs section)

@HotCakeX HotCakeX closed this as not planned Won't fix, can't repro, duplicate, stale Jan 17, 2025
@HotCakeX HotCakeX changed the title "WMI query for 'MSFT_MpPreference' failed: Generic Fail " [Caused by 3rd party security solution] "WMI query for 'MSFT_MpPreference' failed: Generic Fail " Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Need more info The user needs to provide more info.
Projects
None yet
Development

No branches or pull requests

2 participants