I'm running a PowerShell script that monitors about 900 devices every 30 minutes using the Get-MpComputerStatus cmdlet. Occasionally, I find that it fails to return any data or errors out on random devices once or twice a week. However, by the next polling interval, it seems to recover, providing the expected data. Has anyone else encountered this sporadic issue with Get-MpComputerStatus? What could be causing this, and do you have any workarounds?
3 Answers
Thanks for the tip! I'll ensure that Defender is running before executing my script. I’ve noticed that sometimes .NET fails to initialize, which can also cause cmdlets to error out. I think the intermittent failures could be linked to either Defender not starting or .NET issues. I’ll implement a check for Defender and adjust the script to handle .NET initialization failures better.
I haven't experienced this issue before. Could you share a relevant part of your script? It might help us pinpoint the problem if we can see the logic you're using.
Usually, this happens when Windows Defender isn't running properly. You can try forcing it to start with: "C:Program FilesWindows DefenderMpCmdRun.exe /wdenable". After that, running Get-MpComputerStatus should return the expected data again.

Related Questions
Can't Load PhpMyadmin On After Server Update
Redirect www to non-www in Apache Conf
How To Check If Your SSL Cert Is SHA 1
Windows TrackPad Gestures