Forum Discussion

Rahul_Fadnavis's avatar
Rahul_Fadnavis
Copper Contributor
Aug 13, 2020

"An attempt to connect to WMI" error in enabling always on using Enable-SqlAlwaysOn using powershell

Hello, I am getting below error while enabling the SQL Server always on using powershell.

 

*** Enable-SqlAlwaysOn : An attempt to connect to WMI on 'XXXXXXXXXXXX' failed with following error: SQL Server WMI provider is not available on XXXXXXXXXXXX..

 

*** Windows version: Windows Server 2019 Standard Edition

SQL Server Vesrion: SQL Server 2019

 

I have already tried registering mofcomp.exe sqlmgmproviderxpsp2up.mof from command prompt and rebooting the server.

 

Earlier only 13.000 folder was exist in C:\Windows\assembly\GAC_MSIL\Microsoft.SqlServer.SqlManagement, but I have created 14.000 and 15.000 folder as well and copied the required dll. still did not work.

 

Any help and solution will be appreciated.

 

Thanks, Rahul

2 Replies

  • v-gudmk1820's avatar
    v-gudmk1820
    Copper Contributor
    If you are using Import-module SqlServer then have you tried Import-Module SqlPS instead? Just to test.
    Also, are you using a named instance or the default instance?
    Just guessing that the problem is related to the service name MSSQL$<instancename>

Resources