This function centralizes all requests for information retrieved from Get-WmiObject or Get-CimInstance.
It uses different protocols as available in this order:
– Cim over WinRM
– Cim over DCOM
– Wmi over PowerShell Remoting
It remembers channels that didn’t work and will henceforth avoid them. It remembers invalid credentials and will avoid reusing them.
Much of its behavior can be configured using Test-DbaWmConnection.
Retrieves the common operating system informations from the local computer.
Retrieves the common operating system informations from the server sql2014.
It will use the credewntials stored in $cred to connect, unless they are known to not work, in which case they will default to windows credentials (unless another default has been set).
Get-DbaCmObject -Computername “sql2014” -ClassName Win32_OperatingSystem -Credential $cred -DoNotUse CimRM