I have a fresh installation of Microsoft SQL Server 2022 on Windows Server 2022 Standard. I'm attempting to enable Always On Availability Groups with the Enable-SqlAlwaysOn
PowerShell commandlet but it fails with "An attempt to connect to WMI on 'COMPUTERNAME' failed with the following error: SQL Server WMI provider is not available on COMPUTERNAME..".
In the past I've run into WMI issues after in-place OS upgrades however this is a new server and no other versions of SQL Server have ever been installed on it. SQL Server 2022 Configuration Manager launches without issue. Running mofcomp "C:\Program Files (x86)\Microsoft SQL Server\160\Shared\sqlmgmprovider.mof"
hasn't fixed the issue. My account is part of sysadmin
and I've verified I can connect to the instance.
This is something I'd expect to work out of the box and I'm not sure what to troubleshoot or try next.
The class-names are identical between and computermanagement15
on 2019 and computermanagement16
on 2022. This is the output of Get-CimClass -Namespace "root\microsoft\sqlserver\computermanagement16" | Select-Object -ExpandProperty CimClassName
CIM_Indication
CIM_ClassIndication
CIM_ClassDeletion
CIM_ClassCreation
CIM_ClassModification
CIM_InstIndication
CIM_InstCreation
CIM_InstModification
CIM_InstDeletion
__NotifyStatus
__ExtendedStatus
CIM_Error
MSFT_WmiError
MSFT_ExtendedStatus
__SecurityRelatedClass
__Trustee
__NTLMUser9X
__ACE
__SecurityDescriptor
__PARAMETERS
__SystemClass
__ProviderRegistration
__EventProviderRegistration
__ObjectProviderRegistration
__ClassProviderRegistration
__InstanceProviderRegistration
__MethodProviderRegistration
__PropertyProviderRegistration
__EventConsumerProviderRegistration
__thisNAMESPACE
__NAMESPACE
__IndicationRelated
__FilterToConsumerBinding
__EventConsumer
__AggregateEvent
__TimerNextFiring
__EventFilter
__Event
__NamespaceOperationEvent
__NamespaceModificationEvent
__NamespaceDeletionEvent
__NamespaceCreationEvent
__ClassOperationEvent
__ClassDeletionEvent
__ClassModificationEvent
__ClassCreationEvent
__InstanceOperationEvent
__InstanceCreationEvent
__MethodInvocationEvent
__InstanceModificationEvent
__InstanceDeletionEvent
__TimerEvent
__ExtrinsicEvent
__SystemEvent
__EventDroppedEvent
__EventQueueOverflowEvent
__QOSFailureEvent
__ConsumerFailureEvent
__EventGenerator
__TimerInstruction
__AbsoluteTimerInstruction
__IntervalTimerInstruction
__Provider
__Win32Provider
__SystemSecurity
ClientSettings
ServerSettingsExtendedProtection
SqlErrorLogEvent
ClientNetworkProtocol
ServerNetworkProtocol
SqlServerAlias
ServerNetworkProtocolProperty
ServerSettings
HADRServiceSettings
SqlServiceAdvancedProperty
SecurityCertificate
ClientSettingsGeneralFlag
ClientNetLibInfo
ServerNetworkProtocolIPAddress
SqlService
RegServices
ClientNetworkProtocolProperty
ServerSettingsGeneralFlag
FilestreamSettings
SqlErrorLogFile
Microsoft.SqlServer.Smo
andMicrosoft.SqlServer.SqlWmiManagement
both exist version16.0.0.0
compared to15.0.0.0
for 2019 installs.New-Object -TypeName 'Microsoft.SqlServer.Management.Smo.Wmi.ManagedComputer'
doesn't populateServices
,ClientProtocols
,ServerInstances
, norServerAliases
but does for 2019 which I think is related.