Hi everyone, long time lurker, first time poster... Had to create an account to respond to this, though. Rebuilding the WMI repository should be your absolute last resort, especially if you are using SCCM. And if you MUST rebuild it, don't use that script. See this blog post for the reasons why, and for the instructions on correctly rebuilding the WMI repository:
https://blogs.technet.microsoft.com/askperf/2014/08/08/wmi-repository-corruption-or-not/