mirror of
https://github.com/fleetdm/fleet
synced 2026-04-21 21:47:20 +00:00
<!-- Add the related story/sub-task/bug number, like Resolves #123, or remove if NA --> **Related issue:** Resolves #38252 This pull request improves the Windows MDM unregistration PowerShell script by adding extra checks and cleanup steps to ensure devices are properly unenrolled and that the state is clearly reported. The script now checks for relevant registry values before and after unregistration, and explicitly clears any remaining values to guarantee correct detection by Fleet. Enhancements to device unregistration and registry cleanup: * Added a pre-check for `DiscoveryServiceFullURL` registry values before attempting to unregister the device, to provide clearer output about the device's enrollment state. * After calling the `UnregisterDeviceWithManagement` API, the script now explicitly removes any remaining `DiscoveryServiceFullURL` values from enrollment keys that have a `UPN`, ensuring Fleet properly detects the device as unenrolled. * Improved output messages to clearly indicate the actions taken and the resulting device state, including whether registry values were found, cleared, or already absent. * Added error handling to exit with a non-zero code if an error occurs during unregistration. |
||
|---|---|---|
| .. | ||
| configuration-profiles | ||
| policies | ||
| queries | ||
| scripts | ||
| software | ||