We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 51f4128 commit 48399deCopy full SHA for 48399de
microsoft/testsuites/mdatp/check-mdatp.sh
@@ -113,5 +113,20 @@ if [ -f "$MDATP_OPT_DIR/mdatp_onboard.json" ]; then
113
EXIT_CODE=$EXIT_ONBOARD_INFO_FOUND
114
fi
115
116
+# special log line if mdatp installed and reports it is onboarded
117
+MDATP_ORG_ID=$(\
118
+ command -v mdatp \
119
+ && mdatp health \
120
+ | grep --fixed-strings 'org_id:' \
121
+ | cut -f 2 -d ':' \
122
+ | tr -d '[:blank:][:punct:]' \
123
+)
124
+if [ -n "$MDATP_ORG_ID" ]; then
125
+ echo "$ERROR_MSG_HEADER" >&2
126
+ echo "ERROR: mdatp is installed and reports this device is onboarded:" >&2
127
+ sudo mdatp health >&2
128
+ EXIT_CODE=$EXIT_ONBOARD_INFO_FOUND
129
+fi
130
+
131
# returns nonzero value if defender info is found
132
exit $EXIT_CODE
0 commit comments