@rr-4098 Thanks for posting in our Q&A.
In our official article, it shows that "Before you can add custom settings to a policy, you must prepare a JSON file, and a discovery script for use with each supported platform. Both the script and JSON become part of the compliance policy." Here is the link:
https://learn.microsoft.com/en-us/mem/intune/protect/compliance-use-custom-settings
The JSON file defines the custom settings and the values that you considered to be compliant. Here is an example of JSON file:
https://learn.microsoft.com/en-us/mem/intune/protect/compliance-custom-json
Discovery scripts are specific to the different platforms and are delivered to devices as part of the compliance policy. When a device evaluates its policy, the script detects (discovers) the settings from the JSON file, and then reports the results to Intune.
https://learn.microsoft.com/en-us/mem/intune/protect/compliance-custom-script
Hope it will give you some ideas.
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.