1

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
14
  • Check the firewalls Dec 22, 2022 at 14:15
  • @DominiqueBoucher the firewall's open. This command is running on the local server that's hosting the database too. I've done the same thing with 2019 installs without issue so a bit stumped here. Dec 23, 2022 at 3:55
  • Are you running it locally or remotely? Have you verified the namespaces exist? Dec 23, 2022 at 15:19
  • @SeanGallardy, re-approaching this now that I've returned from holidays. I'm getting the same results through WinRM and PowerShell as admin on the server. I've verified Microsoft.SqlServer.Smo and Microsoft.SqlServer.SqlWmiManagement both exist version 16.0.0.0 compared to 15.0.0.0 for 2019 installs. New-Object -TypeName 'Microsoft.SqlServer.Management.Smo.Wmi.ManagedComputer' doesn't populate Services, ClientProtocols, ServerInstances, nor ServerAliases but does for 2019 which I think is related. Feb 2, 2023 at 7:40
  • Did you look at the actual WMI namespace to see if it exists? Feb 2, 2023 at 14:12

1 Answer 1

0

Using the current pre-release version of the SqlServer PowerShell Module (22.0.49-preview) fixes the connection issue. It fails with the latest release version (21.1.18256) which was released in July 2021.

1
  • This is because the old versions aren't looking for the new namespace. This is expected, hence why I stated nothing was wrong with the provider and to update whatever powershell cmdlets were being used. Feb 16, 2023 at 11:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.