Thor Logo dbatools

CIM

Get-DbaCmConnection

Friedrich Weinmann (@FredWeinmann)

Get-DbaCmConnection View Source Friedrich Weinmann (@FredWeinmann) Windows, Linux, macOS Synopsis Retrieves cached Windows Management and CIM connections used by dbatools commands Description Shows which remote computer connections are currently cached by dbatools for Windows Management and CIM operations. This helps you understand what authentication contexts are active and troubleshoot connection issues when running dbatools commands against remote SQL Server instances. Cached connections are automatically created when you run dbatools commands that need to access Windows services, registry, or file system on remote servers.

Read more

Get-DbaCmObject

Friedrich Weinmann (@FredWeinmann)

Get-DbaCmObject View Source Friedrich Weinmann (@FredWeinmann) Windows, Linux, macOS Synopsis Retrieves Windows system information from SQL Server hosts using WMI/CIM with intelligent connection fallback. Description Queries Windows Management Instrumentation (WMI) or Common Information Model (CIM) classes on SQL Server hosts to gather system-level information like hardware specs, operating system details, services, and performance counters. This function automatically tries multiple connection protocols in order of preference (CIM over WinRM, CIM over DCOM, WMI, then WMI over PowerShell Remoting) and remembers which methods work for each server to optimize future connections.

Read more

Get-DbaUptime

Stuart Moore (@napalmgram), stuart-moore.com

Get-DbaUptime View Source Stuart Moore (@napalmgram), stuart-moore.com Windows, Linux, macOS Synopsis Retrieves uptime information for SQL Server instances and their hosting Windows servers Description This function determines SQL Server uptime by checking the tempdb creation date and calculates Windows server uptime using CIM/WMI calls to get the last boot time. Essential for monitoring system stability, troubleshooting unexpected restarts, and generating compliance reports that require uptime documentation. Returns both raw TimeSpan objects for calculations and formatted strings for reporting, covering both the SQL Server service and the underlying Windows host.

Read more

New-DbaCmConnection

New-DbaCmConnection View Source Windows, Linux, macOS Synopsis Creates and configures connection objects for remote computer management using CIM/WMI protocols. Description Creates connection objects that optimize remote computer management for SQL Server environments using CIM and WMI protocols. These objects cache successful authentication methods and connection protocols, reducing authentication errors and improving performance when connecting to multiple SQL Server instances across different servers. The function pre-configures connection settings including credentials, preferred protocols (CIM over WinRM or DCOM), and failover behavior.

Read more

Remove-DbaCmConnection

Friedrich Weinmann (@FredWeinmann)

Remove-DbaCmConnection View Source Friedrich Weinmann (@FredWeinmann) Windows, Linux, macOS Synopsis Removes cached Windows Management and CIM connections from the dbatools connection cache. Description Clears cached connection objects that dbatools uses for remote computer management operations like accessing Windows services, registry, and file systems on SQL Server instances. When you run dbatools commands against remote servers, these connections are automatically created and cached to improve performance and reduce authentication overhead.

Read more

Set-DbaCmConnection

Friedrich Weinmann (@FredWeinmann)

Set-DbaCmConnection View Source Friedrich Weinmann (@FredWeinmann) Windows, Linux, macOS Synopsis Configures remote computer connection settings for SQL Server host management. Description Configures connection objects that dbatools uses to manage remote SQL Server host computers via CIM, WMI, and PowerShell remoting. This function creates new connection records for computers not yet cached, or modifies existing connection settings for previously contacted hosts. Use this to bulk-configure connection behavior, manage credential caching, or troubleshoot remote connection issues when dbatools functions need to access SQL Server host systems for tasks like service management, file operations, or system information gathering.

Read more

Test-DbaCmConnection

Friedrich Weinmann (@FredWeinmann)

Test-DbaCmConnection View Source Friedrich Weinmann (@FredWeinmann) Windows, Linux, macOS Synopsis Tests remote computer management connectivity using multiple protocols and caches optimal connection methods Description Tests remote computer connectivity across four different management protocols to determine the most reliable connection method for SQL Server administration tasks. This function evaluates connectivity for: CIM over WinRM (Windows Remote Management) CIM over DCOM (Distributed Component Object Model) WMI (Windows Management Instrumentation) PowerShell Remoting Results are cached and automatically used by other dbatools commands like Get-DbaCmObject and Invoke-DbaCmMethod to optimize future connections.

Read more