Win32_PortResource, root/CIMV2, VBScript samples, description

WUtils.com

VB Script | C# | VB.Net | Methods | Properties (11) | Qualifiers (4) | Instances (10)

Win32_PortResource class derivation info

Report generated from: Microsoft Windows Server 2012 R2 Standard Evaluation

Win32_PortResource - VB Script code samples

Get instance of WMI class using GetObject

Short VBS code - get a single specified instance of Win32_PortResource class or get a default unnamed instance (singleton) of the class, using one single command GetObject with exact path of the wmi object.
	
	'http://wutils.com/wmi/
	Dim wmiObject
	Set wmiObject = GetObject( _
	 "WINMGMTS:\\.\ROOT\CIMV2:" + _
	 "Win32_PortResource.StartingAddress=""98""")
	Wscript.Echo wmiObject.Alias 'or other property name, see properties
	

Alternative codes

SWbemServices.Get

Quickest and most efficient VB Script code to get a single instance by a key - SWbemServices.Get
	'http://wutils.com/wmi/
	Dim oWMI, Instance
	
	'Get base WMI object, "." means computer name (local)
	Set oWMI = GetObject("WINMGMTS:\\.\ROOT\CIMV2")
	
	Do
	  'Get the instance of Win32_PortResource 
	  Set Instance = oWMI.Get("Win32_PortResource.StartingAddress=""98""")
	                    
	  'Do something with the instance
	  Wscript.Echo Instance.Alias 'or other property name, see properties
	
	  'Wait for some time to get next value
	  Wscript.Sleep 1000
	Loop While True  
	  
	

WMI query - sample windows WQL

Get a specified instance of Win32_PortResource by key, get a default unnamed instance (singleton) of the class or list instances of the class by wmi query using this VB Script.
	'http://wutils.com/wmi/
	Dim oWMI, WQL, Instances, Instance
	
	'Get base WMI object, "." means computer name (local)
	Set oWMI = GetObject("WINMGMTS:\\.\ROOT\CIMV2")
	
	'Create a WMI query text 
	WQL = "Select * from Win32_PortResource Where StartingAddress=""98"""
	
	'Get instances of Win32_PortResource 
	Set Instances = oWMI.ExecQuery(WQL)
	                    
	'Enumerate instances  
	For Each Instance In Instances 
	  'Do something with the instance
	  Wscript.Echo Instance.Alias 'or other property name
	Next 'Instance
	

InstancesOf

List of all instances, wmi class Win32_PortResource.
	'http://wutils.com/wmi/
	Dim oWMI, Instances, Instance
	
	'Get base WMI object, "." means computer name (local)
	Set oWMI = GetObject("WINMGMTS:\\.\ROOT\CIMV2")
	
	'Get instances of Win32_PortResource - all instances of this class and derived classes 
	'Set Instances = oWMI.InstancesOf("Win32_PortResource")
	
	'Get instances of Win32_PortResource 
	Set Instances = oWMI.InstancesOf("Win32_PortResource", 1)
	
	
	'Enumerate instances  
	For Each Instance In Instances 
	  'Do something with the instance
	  Wscript.Echo Instance.Alias 'or other property name
	Next 'Instance
	

WMI remote scripting - Locator, Connect

Get WMI management object using SWbemLocator.ConnectServer method. You can connect to a remote computer and specify Username/Password for the WMI connection.
	'http://wutils.com/wmi/
	Dim Locator, oWMI, WQL, Instances, Instance
	
	'Create Locator object
	Set Locator = CreateObject("WbemScripting.SWbemLocator")
	
	'Get base WMI object
	Set oWMI = Locator.ConnectServer("MachineName", "ROOT\CIMV2", "MachineName\administrator", "Password")
	 
	'.... continue using oWMI object
	
	

Win32_PortResource - c# code samples

WMI query - sample windows WQL with C#

Get a specified instance of Win32_PortResource by key, get a default unnamed instance (singleton) of the class or list instances of the class by wmi query using this c# sample code.
	//http://wutils.com/wmi/
	
	//Project -> Add reference -> System.Management
	//using System.Management;
	
	//create a management scope object
	ManagementScope scope = new ManagementScope("\\\\.\\ROOT\\CIMV2");
	
	//create object query
	ObjectQuery query = new ObjectQuery("SELECT * FROM Win32_PortResource");
	
	//create object searcher
	ManagementObjectSearcher searcher =
	                        new ManagementObjectSearcher(scope, query);
	
	//get collection of WMI objects
	ManagementObjectCollection queryCollection = searcher.Get();
	
	//enumerate the collection.
	foreach (ManagementObject m in queryCollection) 
	{
	// access properties of the WMI object
	  Console.WriteLine("Alias : {0}", m["Alias"]);
	  
	}
	

WMI query - list of class instances

Get a specified instance of Win32_PortResource by key, get a default unnamed instance (singleton) of the class or list instances of the class by wmi query using this c# sample code.
See in another language: VBScript, VB.Net.
	//http://wutils.com/wmi/
	
	//Project -> Add reference -> System.Management
	//using System.Management;
	
	//get the ManagementClass
	ManagementClass oClass = new ManagementClass("Win32_PortResource");
	
	//Get all instances of the class and enumerate them
	foreach (ManagementObject oObject in oClass.GetInstances())
	{
	    //access a property of the Management object
	    Console.WriteLine("Alias : {0}", oObject["Alias"]);
	}
	
	

Win32_PortResource - VB.Net code samples

WMI query - sample windows WQL with VB.Net

Get a specified instance of Win32_PortResource by key, get a default unnamed instance (singleton) of the class or list instances of the class by wmi query using this VB.Net sample code.
	  'Project -> Add reference -> System.Management
	  'Imports System.Management
	  
	  'Get the namespace management scope
	  Dim Scope As New ManagementScope("\\.\ROOT\CIMV2")
	  
	  'Get a result of WML query 
	  Dim Query As New ObjectQuery("SELECT * FROM Win32_PortResource")
	  
	  'Create object searcher
	  Dim Searcher As New ManagementObjectSearcher(Scope, Query)
	  
	  'Get a collection of WMI objects
	  Dim queryCollection As ManagementObjectCollection = Searcher.Get
	  
	  'Enumerate wmi object 
	  For Each mObject As ManagementObject In queryCollection
	    'write out some property value
	    Console.WriteLine("Alias : {0}", mObject("Alias"))
	  Next
	

Win32_PortResource properties

NameCIMTypeIsArrayIsLocalOriginMappingStringsreadQualifiers
Alias11,booleanNOYESWin32_PortResourceArray["Win32API|Configuration Manager Structures|IO_INFO"]True-
Caption8,stringNONOCIM_ManagedSystemElementTrueMaxLen=&64
CreationClassName8,stringNONOCIM_MemoryMappedIOTrueCIM_Key=True,MaxLen=&256
CSCreationClassName8,stringNONOCIM_MemoryMappedIOTrueCIM_Key=True,MaxLen=&256,Propagated="CIM_ComputerSystem.CreationClassName"
CSName8,stringNONOCIM_MemoryMappedIOTrueCIM_Key=True,MaxLen=&256,Propagated="CIM_ComputerSystem.Name"
Description8,stringNONOCIM_ManagedSystemElementTrue-
EndingAddress21,uint64NONOCIM_MemoryMappedIOArray["MIF.DMTF|Memory Mapped I/O|001.2"]True-
InstallDate101,datetimeNONOCIM_ManagedSystemElementArray["MIF.DMTF|ComponentID|001.5"]True-
Name8,stringNONOCIM_ManagedSystemElementTrue-
key
StartingAddress
21,uint64NONOCIM_MemoryMappedIOArray["MIF.DMTF|Memory Mapped I/O|001.1"]TrueCIM_Key=True,key=True,Override="StartingAddress"
Status8,stringNONOCIM_ManagedSystemElementTrueMaxLen=&10,ValueMap=Array["OK","Error","Degraded","Unknown","Pred Fail","Starting","Stopping","Service","Stressed","NonRecover","No Contact","Lost Comm"]

Instances of Win32_PortResource

This section contains sample wmi instances of Win32_PortResource class with their properties from Microsoft Windows Server 2012 R2 Standard Evaluation.

Instances of Win32_PortResource class

10 of 10 instances.
StartingAddress"98""102""8192""240""0""3328""46""78""5710""97"
AliasFalseFalseFalseFalseFalseFalseFalseFalseFalseFalse
Caption"0x00000062-0x00000062""0x00000066-0x00000066""0x00002000-0x000020FF""0x000000F0-0x000000F0""0x00000000-0x00000CF7""0x00000D00-0x0000FFFF""0x0000002E-0x0000002F""0x0000004E-0x0000004F""0x0000164E-0x0000164F""0x00000061-0x00000061"
CreationClassName"Win32_PortResource""Win32_PortResource""Win32_PortResource""Win32_PortResource""Win32_PortResource""Win32_PortResource""Win32_PortResource""Win32_PortResource""Win32_PortResource""Win32_PortResource"
CSCreationClassName"Win32_ComputerSystem""Win32_ComputerSystem""Win32_ComputerSystem""Win32_ComputerSystem""Win32_ComputerSystem""Win32_ComputerSystem""Win32_ComputerSystem""Win32_ComputerSystem""Win32_ComputerSystem""Win32_ComputerSystem"
CSName".""."".""."".""."".""."".""."
Description"0x00000062-0x00000062""0x00000066-0x00000066""0x00002000-0x000020FF""0x000000F0-0x000000F0""0x00000000-0x00000CF7""0x00000D00-0x0000FFFF""0x0000002E-0x0000002F""0x0000004E-0x0000004F""0x0000164E-0x0000164F""0x00000061-0x00000061"
EndingAddress"98""102""8447""240""3319""65535""47""79""5711""97"
InstallDateNullNullNullNullNullNullNullNullNullNull
Name"0x00000062-0x00000062""0x00000066-0x00000066""0x00002000-0x000020FF""0x000000F0-0x000000F0""0x00000000-0x00000CF7""0x00000D00-0x0000FFFF""0x0000002E-0x0000002F""0x0000004E-0x0000004F""0x0000164E-0x0000164F""0x00000061-0x00000061"
Status"OK""OK""OK""OK""OK""OK""OK""OK""OK""OK"

Win32_PortResource Qualifiers

NameValueToInstanceToSubclassOverridableAmendedLocal
dynamicTrueYESNOYESNOYES
Locale&1033YESNOYESNOYES
provider"CIMWin32"YESNOYESNOYES
UUID"{8502C4D0-5FBB-11D2-AAC1-006008C78BC7}"YESNOYESNOYES

Win32_PortResource System properties

NameValueOriginCimTypeLocalArray
__PATH"\\.\ROOT\CIMV2:Win32_PortResource"___SYSTEM8FalseFalse
__NAMESPACE"ROOT\CIMV2"___SYSTEM8FalseFalse
__SERVER"."___SYSTEM8FalseFalse
__DERIVATIONArray["Win32_SystemMemoryResource","CIM_MemoryMappedIO","CIM_SystemResource","CIM_LogicalElement","CIM_ManagedSystemElement"]___SYSTEM8FalseTrue
__PROPERTY_COUNT&11___SYSTEM3FalseFalse
__RELPATH"Win32_PortResource"___SYSTEM8FalseFalse
__DYNASTY"CIM_ManagedSystemElement"___SYSTEM8FalseFalse
__SUPERCLASS"Win32_SystemMemoryResource"___SYSTEM8FalseFalse
__CLASS"Win32_PortResource"___SYSTEM8FalseFalse
__GENUS&1___SYSTEM3FalseFalse
www.wutils.com/wmi/ - WMI reference for windows server. Quick VBScript and c# code samples.
online utility - toplist
WUtils.com