February 2019
Intermediate to advanced
626 pages
15h 51m
English
The Get-CimAssociatedClass command replaces the use of the ASSOCIATORS OF query type when using the CIM cmdlets.
The following command gets the class instances associated with Win32_NetworkAdapterConfiguration. As the arguments for the Get-CimInstance command are long strings, splatting is used to pass the parameters into the command:
$params = @{
ClassName = 'Win32_NetworkAdapterConfiguration'
Filter = 'IPEnabled=TRUE AND DHCPEnabled=TRUE'
}
Get-CimInstance @params | Get-CimAssociatedInstance
The following example uses Get-CimAssociatedClass to get the physical interface associated with the IP configuration:
$params = @{ ClassName = 'Win32_NetworkAdapterConfiguration' Filter = 'IPEnabled=TRUE AND DHCPEnabled=TRUE' } ...Read now
Unlock full access