Hi Mishua,
Thank you for asking this question on the Microsoft Q&A Platform.
I came across this script and will be using it my lab however it does the job as per the Github repo, so please review this and try out.
DataSyncMetadataCleanup
If it does not map your requirements, I will suggest you can raise a support ticket with Microsoft.
==
Please "Accept the answer" if the information helped you. This will help us and others in the community as well.