Main example
List instances
# Abstract class: Get-CimInstance returns the instances of its subclasses
Get-CimInstance -ClassName CIM_PhysicalLink |
Select-Object -Property @(
'Tag'
'Description'
'Status'
'Manufacturer'
'Model'
'Version'
'SerialNumber'
)Abstract class: it has no instances of its own. Get-CimInstance returns the instances of its subclasses.
Examples
Decode numeric values
# Lookup table for MediaType (values documented by Microsoft)
$mediaTypeName = @{
0 = 'Unknown'
1 = 'Other'
2 = 'Cat1'
3 = 'Cat2'
4 = 'Cat3'
5 = 'Cat4'
6 = 'Cat5'
7 = '50-ohm Coaxial'
8 = '75-ohm Coaxial'
9 = '100-ohm Coaxial'
10 = 'Fiber-optic'
11 = 'UTP'
12 = 'STP'
13 = 'Ribbon Cable'
14 = 'Twinaxial'
15 = 'Optical 9um'
16 = 'Optical 50um'
17 = 'Optical 62.5um'
}
Get-CimInstance -ClassName CIM_PhysicalLink |
Select-Object -Property @(
'Tag'
'Description'
'Status'
'Manufacturer'
'Model'
'Version'
'SerialNumber'
)Query a remote computer (CIM session)
review before running# Name of the remote computer
$computerName = 'SERVER01'
# The CIM session (WSMan by default) can be reused for several queries
$cimSession = New-CimSession -ComputerName $computerName
try {
Get-CimInstance -CimSession $cimSession -ClassName CIM_PhysicalLink |
Select-Object -Property @(
'Tag'
'Description'
'Status'
'Manufacturer'
'Model'
'Version'
'SerialNumber'
)
} finally {
Remove-CimSession -CimSession $cimSession
}WSMan (WinRM) is used by default. For a host without WinRM, create the session with -SessionOption (New-CimSessionOption -Protocol Dcom). Add -Credential to use another account.
Show the class structure
# Class structure: properties, types and flags (Key, ReadOnly…)
$cimClass = Get-CimClass -ClassName CIM_PhysicalLink
$cimClass.CimClassProperties |
Select-Object -Property Name, CimType, FlagsProperties
| Name | Type | Access | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Caption# | string | read | Short textual description of the object. Code | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| CreationClassName# key | string | read | Name of the class or subclass used in the creation of an instance. When used with other key properties of the class, this property allows all instances of the class and its subclasses to be uniquely identified. Code | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Description# | string | read | Textual description of the object. Code | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| InstallDate# | datetime | read | Date and time the object was installed. This property does not need a value to indicate that the object is installed. Code | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Length# | real64 | read | Current length of the physical link, in feet. For some connections, especially wireless technologies, this property might not be applicable and should be left uninitialized. Unit: feet Code | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Manufacturer# | string | read | Name of the organization responsible for producing the physical element. For more information, see the Vendor property of CIM_Product. Code | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| MaxLength# | real64 | read | Maximum length of the physical link in feet. Unit: feet Code | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| MediaType# | uint16 | read | Type of media through which transmission signals pass. Common network media include twisted-pair, coaxial, and fiber-optic cable. Values (18)
Code | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Model# | string | read | Name by which the physical element is generally known. Code | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Name# | string | read | Label by which the object is known. When subclassed, this property can be overridden to be a key property. Code | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| OtherIdentifyingInfo# | string | read | Additional data, beyond asset tag information, that can be used to identify a physical element. One example is bar-code data that is associated with an element, which also has an asset tag. Note that if only bar-code data is available, and is unique and able to be used as an element key, this property would be null and the bar-code data would be used as the class key in the Tag property. This property is inherited from CIM_PhysicalElement. Code | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PartNumber# | string | read | Part number assigned by the organization responsible for producing or manufacturing the physical element. Code | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PoweredOn# | boolean | read | If TRUE, the physical element is powered on. Code | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| SerialNumber# | string | read | Manufacturer-allocated number used to identify the physical element. Code | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| SKU# | string | read | Stock-keeping unit number for the physical element. Code | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Status# | string | read | Current status of the object. Values include the following: Values (12)
Code | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Tag# key | string | read | Arbitrary string that uniquely identifies the physical element and serves as the element's key. This property can contain information, such as asset tag or serial number data. The key for CIM_PhysicalElement is placed very high in the object hierarchy to independently identify the hardware or entity, regardless of physical placement in (or on) cabinets, adapters, and so on. For example, a removable component that can be hot-swapped can be taken from its containing (scoping) package and be temporarily unused. The object still continues to exist and can even be inserted into a different scoping container. The key for a physical element is an arbitrary string that is defined independently of placement or location-oriented hierarchy. Code | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Version# | string | read | Version of the physical element. Code | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Wired# | boolean | read | If TRUE, the physical link is a cable. Otherwise, it is a wireless connection. Code |
Remarks
The CIM_PhysicalLink class is derived from CIM_PhysicalElement.
WMI does not implement this class.
This documentation is derived from the CIM class descriptions published by the DMTF. Microsoft may have made changes to correct minor errors, conform to Microsoft SDK documentation standards, or provide more information.
Inheritance
Superclass chain
- CIM_ManagedSystemElement
- CIM_PhysicalElement
- CIM_PhysicalLink
Known subclasses
No known subclass.
Requirements
- Namespace
- root/cimv2
- Minimum client
- Windows Vista
- Minimum server
- Windows Server 2008
- MOF file
- CIMWin32.mof
- DLL
- CIMWin32.dll
Class qualifiers
Abstract UUID("{FAF76B82-798C-11D2-AAD1-006008C78BC7}") AMENDMENT
Microsoft source
Descriptions, properties and methods come from the Microsoft documentation (MicrosoftDocs/win32 repository), published under the CC BY 4.0 licence. Formatting and translations are specific to this site; the PowerShell examples are written for it.