Contact Info

Crumbtrail

ActiveXperts.com » Administration » Scripts » WMI Performance Counters » Powershell

NetworkPort - WMI sample in Powershell

The foundations for Manageability in Windows 2019/2012/2008/ and Windows 10/8/7/Vista/XP are Windows Management Instrumentation (WMI; formerly WBEM) and WMI extensions for Windows Driver Model (WDM).

ActiveXperts Network Monitor provides the ability to build monitor check routines based on WMI. ActiveXperts has collected more than a hundred WMI samples. You can use these samples as a base for new check routines you can write yourself.

On this site, you can find many WMI samples.

The NetworkPort WMI class can be used in ActiveXperts Network Monitor to monitor your servers.


NetworkPort

Example(s)

$strComputer = "."

$objWMi = get-wmiobject -namespace root\StandardCimv2 -computername localhost -Query "Select * from CIM_NetworkPort"

foreach ($obj in $objWmi)
{
	write-host "ActiveMaximumTransmissionUnit:" $obj.ActiveMaximumTransmissionUnit
	write-host "AdditionalAvailability:" $obj.AdditionalAvailability
	write-host "AdminLocked:" $obj.AdminLocked
	write-host "AutoSense:" $obj.AutoSense
	write-host "Availability:" $obj.Availability
	write-host "AvailableRequestedStates:" $obj.AvailableRequestedStates
	write-host "Caption:" $obj.Caption
	write-host "CommunicationStatus:" $obj.CommunicationStatus
	write-host "ComponentID:" $obj.ComponentID
	write-host "ConnectorPresent:" $obj.ConnectorPresent
	write-host "CreationClassName:" $obj.CreationClassName
	write-host "Description:" $obj.Description
	write-host "DetailedStatus:" $obj.DetailedStatus
	write-host "DeviceID:" $obj.DeviceID
	write-host "DeviceName:" $obj.DeviceName
	write-host "DeviceWakeUpEnable:" $obj.DeviceWakeUpEnable
	write-host "DriverDate:" $obj.DriverDate
	write-host "DriverDateData:" $obj.DriverDateData
	write-host "DriverDescription:" $obj.DriverDescription
	write-host "DriverMajorNdisVersion:" $obj.DriverMajorNdisVersion
	write-host "DriverMinorNdisVersion:" $obj.DriverMinorNdisVersion
	write-host "DriverName:" $obj.DriverName
	write-host "DriverProvider:" $obj.DriverProvider
	write-host "DriverVersionString:" $obj.DriverVersionString
	write-host "ElementName:" $obj.ElementName
	write-host "EnabledDefault:" $obj.EnabledDefault
	write-host "EnabledState:" $obj.EnabledState
	write-host "EndPointInterface:" $obj.EndPointInterface
	write-host "ErrorCleared:" $obj.ErrorCleared
	write-host "ErrorDescription:" $obj.ErrorDescription
	write-host "FullDuplex:" $obj.FullDuplex
	write-host "HardwareInterface:" $obj.HardwareInterface
	write-host "HealthState:" $obj.HealthState
	write-host "Hidden:" $obj.Hidden
	write-host "HigherLayerInterfaceIndices:" $obj.HigherLayerInterfaceIndices
	write-host "IdentifyingDescriptions:" $obj.IdentifyingDescriptions
	write-host "IMFilter:" $obj.IMFilter
	write-host "InstallDate:" $obj.InstallDate
	write-host "InstanceID:" $obj.InstanceID
	write-host "InterfaceAdminStatus:" $obj.InterfaceAdminStatus
	write-host "InterfaceDescription:" $obj.InterfaceDescription
	write-host "InterfaceGuid:" $obj.InterfaceGuid
	write-host "InterfaceIndex:" $obj.InterfaceIndex
	write-host "InterfaceName:" $obj.InterfaceName
	write-host "InterfaceOperationalStatus:" $obj.InterfaceOperationalStatus
	write-host "InterfaceType:" $obj.InterfaceType
	write-host "iSCSIInterface:" $obj.iSCSIInterface
	write-host "LastErrorCode:" $obj.LastErrorCode
	write-host "LinkTechnology:" $obj.LinkTechnology
	write-host "LowerLayerInterfaceIndices:" $obj.LowerLayerInterfaceIndices
	write-host "MajorDriverVersion:" $obj.MajorDriverVersion
	write-host "MaxQuiesceTime:" $obj.MaxQuiesceTime
	write-host "MaxSpeed:" $obj.MaxSpeed
	write-host "MediaConnectState:" $obj.MediaConnectState
	write-host "MediaDuplexState:" $obj.MediaDuplexState
	write-host "MinorDriverVersion:" $obj.MinorDriverVersion
	write-host "MtuSize:" $obj.MtuSize
	write-host "Name:" $obj.Name
	write-host "NdisMedium:" $obj.NdisMedium
	write-host "NdisPhysicalMedium:" $obj.NdisPhysicalMedium
	write-host "NetLuid:" $obj.NetLuid
	write-host "NetLuidIndex:" $obj.NetLuidIndex
	write-host "NetworkAddresses:" $obj.NetworkAddresses
	write-host "NotUserRemovable:" $obj.NotUserRemovable
	write-host "OperatingStatus:" $obj.OperatingStatus
	write-host "OperationalStatus:" $obj.OperationalStatus
	write-host "OperationalStatusDownDefaultPortNotAuthenticated:" $obj.OperationalStatusDownDefaultPortNotAuthenticated
	write-host "OperationalStatusDownInterfacePaused:" $obj.OperationalStatusDownInterfacePaused
	write-host "OperationalStatusDownLowPowerState:" $obj.OperationalStatusDownLowPowerState
	write-host "OperationalStatusDownMediaDisconnected:" $obj.OperationalStatusDownMediaDisconnected
	write-host "OtherEnabledState:" $obj.OtherEnabledState
	write-host "OtherIdentifyingInfo:" $obj.OtherIdentifyingInfo
	write-host "OtherLinkTechnology:" $obj.OtherLinkTechnology
	write-host "OtherNetworkPortType:" $obj.OtherNetworkPortType
	write-host "OtherPortType:" $obj.OtherPortType
	write-host "PermanentAddress:" $obj.PermanentAddress
	write-host "PnPDeviceID:" $obj.PnPDeviceID
	write-host "PortNumber:" $obj.PortNumber
	write-host "PortType:" $obj.PortType
	write-host "PowerManagementCapabilities:" $obj.PowerManagementCapabilities
	write-host "PowerManagementSupported:" $obj.PowerManagementSupported
	write-host "PowerOnHours:" $obj.PowerOnHours
	write-host "PrimaryStatus:" $obj.PrimaryStatus
	write-host "PromiscuousMode:" $obj.PromiscuousMode
	write-host "ReceiveLinkSpeed:" $obj.ReceiveLinkSpeed
	write-host "RequestedSpeed:" $obj.RequestedSpeed
	write-host "RequestedState:" $obj.RequestedState
	write-host "Speed:" $obj.Speed
	write-host "State:" $obj.State
	write-host "Status:" $obj.Status
	write-host "StatusDescriptions:" $obj.StatusDescriptions
	write-host "StatusInfo:" $obj.StatusInfo
	write-host "SupportedMaximumTransmissionUnit:" $obj.SupportedMaximumTransmissionUnit
	write-host "SystemCreationClassName:" $obj.SystemCreationClassName
	write-host "SystemName:" $obj.SystemName
	write-host "TimeOfLastStateChange:" $obj.TimeOfLastStateChange
	write-host "TotalPowerOnHours:" $obj.TotalPowerOnHours
	write-host "TransitioningToState:" $obj.TransitioningToState
	write-host "TransmitLinkSpeed:" $obj.TransmitLinkSpeed
	write-host "UsageRestriction:" $obj.UsageRestriction
	write-host "Virtual:" $obj.Virtual
	write-host "VlanID:" $obj.VlanID
	write-host "WdmInterface:" $obj.WdmInterface
	write-host
	write-host "########"
	write-host
}