Trigger Windows MDM host enrollment on device when notified that it is enabled (#12426)

This commit is contained in:
Martin Angers
2023-06-26 12:13:17 -04:00
committed by GitHub
parent 4be1da6724
commit ca02abb660
9 changed files with 414 additions and 8 deletions
+8 -2
View File
@@ -614,10 +614,14 @@ func main() {
// create the notifications middleware that wraps the orbit client
// (must be shared by all runners that use a ConfigFetcher).
const renewEnrollmentProfileCommandFrequency = time.Hour
const (
renewEnrollmentProfileCommandFrequency = time.Hour
microsoftMDMEnrollmentCommandFrequency = time.Hour
)
configFetcher := update.ApplyRenewEnrollmentProfileConfigFetcherMiddleware(orbitClient, renewEnrollmentProfileCommandFrequency)
if runtime.GOOS == "darwin" {
switch runtime.GOOS {
case "darwin":
// add middleware to handle nudge installation and updates
const nudgeLaunchInterval = 30 * time.Minute
configFetcher = update.ApplyNudgeConfigFetcherMiddleware(configFetcher, update.NudgeConfigFetcherOptions{
@@ -626,6 +630,8 @@ func main() {
configFetcher = update.ApplyDiskEncryptionRunnerMiddleware(configFetcher)
configFetcher = update.ApplySwiftDialogDownloaderMiddleware(configFetcher, updateRunner)
case "windows":
configFetcher = update.ApplyMicrosoftMDMEnrollmentFetcherMiddleware(configFetcher, microsoftMDMEnrollmentCommandFrequency, orbitHostInfo.HardwareUUID)
}
const orbitFlagsUpdateInterval = 30 * time.Second