What's new in 2.24.2

October 26, 2022 in Releases by David Wiseman2 minutes

What's new in 2.24.2

WMI collection improvements...

Changes to WMI Collections

Changes have been made to WMI collections - relating to issue #299. The collections are now done through Microsoft.Management.Infrastructure instead of System.Management. This is the newer/reccomended way make WMI calls in .NET. By default the WMI calls will now use WSMan/WinRM instead of DCOM. This uses 1 dedicated firewall port (5985) so it’s easier to provision access. Unfortunatley local admin permissions are still needed for WMI calls to work.

If you are familiar with PowerShell, the old method was similar to:

Get-WmiObject -Class Win32_computerSystem -ComputerName "NAME_HERE"

The new method is similar to :

Get-CimInstance -Class Win32_computerSystem -ComputerName "NAME_HERE"

Switching to use just WSMan is potentially a breaking change so DBA Dash will first attempt to connect via WSMan then use DCOM if that fails. This is similar to using the old Get-WmiObject or passing the DCOM protocol session option:

[Microsoft.Management.Infrastructure.CimCmdlets.ProtocolType]$Protocol = 'DCOM'

$option = New-CimSessionOption -Protocol $protocol
$session = New-CimSession -ComputerName "LAB2012" -SessionOption $option
Get-CimInstance -CimSession $session -ClassName Win32_computerSystem

Testing which method works adds a potential performnace overhead. This is avoided by caching the protocol option so that it will be used for any subsequent WMI collections.

As part of the drivers collection, a registry key is read to determine the PV driver version (For AWS). Previously this used RegistryKey.OpenRemoteBaseKey which required a different port to be enabled and the remote registry service to be running. This is now done using Microsoft.Management.Infrastructure which simplifies access.

How do I get WMI collections to work?

On servers WinRM should be enabled by default. If you need to enable it manually, run this on the monitored instance:

Enable-PSRemoting -SkipNetworkProfileCheck -Force

This does a number of tasks including creating the firewall exception.

The DBA Dash service account should be a member of the local administrators group on the monitored instance.

## Option to add new service account to local admins to get WMI calls to work
Invoke-Command -ComputerName SQL1,SQL2 -ScriptBlock {Add-LocalGroupMember -Group "Administrators" -Member "DBADash$" }

Further reading:

WMI Collections

https://powershell.one/wmi/remote-access

Other changes

2.24.2 also includes a few other fixes and improvements:

  • Fix for backup collection on re-named instances
  • Progress bar fix for drive free space
  • Connect dialog database list is now sorted alphabetically

See here for a full list of changes.