I enroll the device using qrCode and have not disabled factory reset. But once I factory reset the device, the device no longer stays enrolled and becomes a simple personal phone.
Is there a way, the device stays enrolled after factory reset or any soft reset functionality?
You may want to consider Zero-Touch Enrollment. With this method, the admins can create configurations containing the provisioning details and devices will automatically provision themselves on first boot or after a factory reset. ZeroTouch capability requires the devices be purchased from an authorized zero-touch reseller. Please take note that even though the device stays enrolled, after factory reset, the user data will be deleted. You may refer to this documentation for more information.