availability_group_id - property in ROOT\WMI namespace

availability_group_id in other namespaces

List of classes with availability_group_id local property in ROOT\WMI namespace

propertyClassOrigin
availability_group_idalwayson_ddl_executedalwayson_ddl_executed
availability_group_idavailability_group_lease_expiredavailability_group_lease_expired
availability_group_idavailability_replica_automatic_failover_validationavailability_replica_automatic_failover_validation
availability_group_idavailability_replica_stateavailability_replica_state
availability_group_idavailability_replica_state_changeavailability_replica_state_change
availability_group_idhadr_cannot_create_listenerhadr_cannot_create_listener
availability_group_idhadr_capture_log_blockhadr_capture_log_block
availability_group_idhadr_capture_vlfheaderhadr_capture_vlfheader
availability_group_idhadr_database_flow_control_actionhadr_database_flow_control_action
availability_group_idhadr_modify_listener_porthadr_modify_listener_port
availability_group_idhadr_partner_updated_lsnshadr_partner_updated_lsns
availability_group_idhadr_sql_instance_to_node_map_entry_created_updatedhadr_sql_instance_to_node_map_entry_created_updated
availability_group_idhadr_sql_instance_to_node_map_entry_deletedhadr_sql_instance_to_node_map_entry_deleted
availability_group_idhadr_sql_instance_to_node_map_key_created_openedhadr_sql_instance_to_node_map_key_created_opened
availability_group_idhadr_tds_synchronizer_payload_skiphadr_tds_synchronizer_payload_skip
availability_group_idhadr_transport_dump_messagehadr_transport_dump_message
availability_group_idhadr_transport_flow_control_actionhadr_transport_flow_control_action
availability_group_idhadr_transport_get_messagehadr_transport_get_message
availability_group_idhadr_transport_route_messagehadr_transport_route_message
availability_group_idhadr_transport_session_statehadr_transport_session_state
availability_group_idhadr_transport_ucs_connection_infohadr_transport_ucs_connection_info
availability_group_idhadr_wsfc_bring_ag_listener_onlinehadr_wsfc_bring_ag_listener_online
availability_group_idhadr_wsfc_change_notifier_start_ag_specific_notificationshadr_wsfc_change_notifier_start_ag_specific_notifications
availability_group_idhadr_wsfc_rollback_ag_listener_changehadr_wsfc_rollback_ag_listener_change
availability_group_idhadr_wsfc_update_ag_listener_dependencyhadr_wsfc_update_ag_listener_dependency

Code samples for availability_group_id property

Get instance of WMI class using GetObject, availability_group_id property of hadr_capture_vlfheader

Short VBS code - get a single specified instance of hadr_capture_vlfheader class or get a default unnamed instance (singleton) of the class, using one single command GetObject with exact path of the wmi object.

'https://wutils.com/wmi/
Dim wmiObject
Set wmiObject = GetObject( _
 "WINMGMTS:\\.\ROOT\WMI:" + _
 "hadr_capture_vlfheader.PropertyName=""SomeText""")
Wscript.Echo wmiObject.availability_group_id 'or other property name, see properties
See more VBS samples of hadr_capture_vlfheader class

WMI query - sample windows WQL with C#, availability_group_id property of hadr_capture_vlfheader

Get a specified instance of hadr_capture_vlfheader by a 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.
//https://wutils.com/wmi/

//Project -> Add reference -> System.Management
//using System.Management;

//create a management scope object
ManagementScope scope = new ManagementScope("\\\\.\\ROOT\\WMI");

//create object query
ObjectQuery query = new ObjectQuery("SELECT * FROM hadr_capture_vlfheader Where PropertyName=\"SomeText\"");

//create object searcher
ManagementObjectSearcher searcher =
                        new ManagementObjectSearcher(scope, query);

//get a collection of WMI objects
ManagementObjectCollection queryCollection = searcher.Get();

//enumerate the collection.
foreach (ManagementObject m in queryCollection) 
{
  // access properties of the WMI object
  Console.WriteLine("availability_group_id : {0}", m["availability_group_id"]);
  
}

WMI query - sample windows WQL with VB.Net, availability_group_id property of hadr_capture_vlfheader

Get a specified instance of hadr_capture_vlfheader by a 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.
See in another language: VBScript, C#
'Project -> Add reference -> System.Management
'Imports System.Management

'Get the namespace management scope
Dim Scope As New ManagementScope("\\.\ROOT\WMI")

'Get a result of WML query 
Dim Query As New ObjectQuery("SELECT * FROM hadr_capture_vlfheader Where PropertyName="SomeText"")

'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("availability_group_id : {0}", mObject("availability_group_id"))
Next
comments powered by Disqus
WUtils.com