imProcessCreate | where (ParentProcessName endswith "\\wbem\\WmiPrvSE.exe" or ActingProcessName endswith "\\wbem\\WmiPrvSE.exe") and ((TargetProcessName endswith "\\certutil.exe" or TargetProcessName endswith "\\cscript.exe" or TargetProcessName endswith "\\mshta.exe" or TargetProcessName endswith "\\msiexec.exe" or TargetProcessName endswith "\\regsvr32.exe" or TargetProcessName endswith "\\rundll32.exe" or TargetProcessName endswith "\\verclsid.exe" or TargetProcessName endswith "\\wscript.exe") or (TargetProcessName endswith "\\cmd.exe" and (TargetProcessCommandLine contains "cscript" or TargetProcessCommandLine contains "mshta" or TargetProcessCommandLine contains "powershell" or TargetProcessCommandLine contains "pwsh" or TargetProcessCommandLine contains "regsvr32" or TargetProcessCommandLine contains "rundll32" or TargetProcessCommandLine contains "wscript"))) and (not((TargetProcessName endswith "\\WerFault.exe" or TargetProcessName endswith "\\WmiPrvSE.exe" or (TargetProcessName endswith "\\msiexec.exe" and TargetProcessCommandLine contains "/i "))))