Allow EnrollmentState to be in status '3' for MDM clients (#17868)

#17692

Recently there was a change that filtered out hosts in `EnrollmentState`
3. This change may cause some hosts that are in otherwise good health to
appear unresponsive to MDM in the management UI.

This change will allow hosts with `EnrollmentStatus` 3 show as enrolled.

The root cause of some hosts being in state 3 is still not entirely
clear, but may have to do with either trying to re-enroll once already
enrolled, or windows updates causing some sort of issue with fleet.

Despite the "failed" `EnrollmentState` 3, the host will still display
that the system is managed by Fleet, and will actively sync.
This commit is contained in:
Dante Catalfamo 2024-03-26 16:33:52 -04:00 committed by GitHub
parent 0752993c93
commit 0b04e7ea9f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View File

@ -0,0 +1 @@
- Fix a bug where valid MDM enrollments would show up as unmanaged (EnrollmentState 3)

View File

@ -506,7 +506,7 @@ var extraDetailQueries = map[string]DetailQuery{
-- coalesce to 'unknown' and keep that state in the list
-- in order to account for hosts that might not have this
-- key, and servers
WHERE COALESCE(e.state, '0') IN ('0', '1', '2')
WHERE COALESCE(e.state, '0') IN ('0', '1', '2', '3')
LIMIT 1;
`,
DirectIngestFunc: directIngestMDMWindows,