Run Cmd as Administrator and execute these commands:
First go to SQL Shared folder according to your sql version:
SQL 2008: C:Program Files (x86)Microsoft SQL Server100Shared
SQL 2012: C:Program Files (x86)Microsoft SQL Server110Shared
SQL 2014: C:Program Files (x86)Microsoft SQL Server120Shared
SQL 2017: C:Program Files (x86)Microsoft SQL Server140Shared -------> My version is 2017
Find more versions here
C:WINDOWSsystem32>cd "C:Program Files (x86)Microsoft SQL Server140Shared"
Then:
C:Program Files (x86)Microsoft SQL Server140Shared>mofcomp sqlmgmproviderxpsp2up.mof
Update:
The problem occurs because the Windows Management Instrumentation (WMI) provider configuration file for manage SQL Server services is missing.so,mofcomp
command repair or recreate it.
Here is more explanation:
https://docs.microsoft.com/en-us/windows/desktop/wmisdk/mofcomp
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…