Skip to content

Unhandled error triggered by Get-MpPreference #83

@itm4n

Description

@itm4n

In some (undetermined) cases, Get-MpPreference throws errors, such as the one below. Such errors should be handled by the script. This cmdlet has an -ErrorAction parameter which could be useful here, but try/catch blocks might also be necessary. This issue could not be reproduced in a lab.

┏━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ CATEGORY ┃ TA0005 - Defense Evasion                          ┃
┃ NAME     ┃ Configuration - MDE State and Settings            ┃
┃ TYPE     ┃ Extended                                          ┃
┣━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
┃ Get information about Microsoft Defender for Endpoint state  ┃
┃ and configuration.                                           ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
Get-MpPreference : Operation failed with the following error: 0x800106ba
At line:544 char:25
+         $MpPreference = Get-MpPreference
+                         ~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (MSFT_MpPreference:root\Microsoft\...FT_MpPreference) [Get-MpPreference], CimException
    + FullyQualifiedErrorId : HRESULT 0x800106ba,Get-MpPreference

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions