>> "Any idea of how this could be done ?"
Not safely, no.
How it's "done" in the real world is one of the following variations:
1. A customer installs a close-but-not correct network driver. Sometime old. Sometimes for a wrong model. Sometimes just a partial install. Sometimes all 3.
And/or
2. The customer installs a "cleaner" app to "fix" their computer. These apps are a scam. Sometimes they're just glorified malware delivery devices. Sometimes they also steal money from customers. (Don't use these, even to try to re-create dumb user-created-problems). Only ever use the built-in Disk Cleanup tool.
Regarding the fix instructions that can be automated in your app, these can be run on even well-functioning computers nothing bad will happen. Namely, because your system is already in good shape. https://wyday.com/limelm/help/faq/#fix-broken-wmi