@Chetan Sharma , I have custom a script comanageddevices-get.ps1. It can query out all the comanaged device and its configurationManagerClientHealthState.
It is in the attachment. As upload the attachment does not support to upload ps1. I have changed the format to txt. You can change back and run with administrator in Powershell ISE. Hope it can help.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.