CollapseAll image

Retrieve Wireless Settings

The following steps describe how to determine whether the wireless interface is active or not and how to identify the active wireless profile.

1.  Retrieve the instance of CIM_WiFiEndpoint, where the “Name” key equals “WiFi Endpoint 0”.

2.  Examine CIM_WiFiEndpoint.EnabledState. Possible values are: Enabled(2), Disabled(3), Enabled but offline(6).

Click here for a snippet demonstrating this step

You can execute this snippet by inserting it into the execution template found here.

  

$wifiEndpointRef =$wsmanConnectionObject.NewReference("SELECT * FROM CIM_WiFiEndpoint WHERE Name='WiFi Endpoint 0'")

$wifiEndpointInstance =$wifiEndpointRef.Get()

$enabledState =$wifiEndpointInstance.GetProperty("EnabledState")

 

 

3.  From the CIM_WiFiEndpoint instance, traverse the CIM_ElementSettingData association using the endpoint reference in the ManagedElement property to find instances of CIM_WiFiEndpointSettings.

4.  Examine the CIM_ElementSettingData.IsCurrent property in the association object. The possible values are: “UnKnown”(0), “IsCurrent”(1), “Is Not Current”(2).

5.  When an object is identified with IsCurrent equal to 1, perform CIM_WiFiEndpointSettings.Get using the endpoint reference in the CIM_ElementSettingData.SettingData property.

Click here for a snippet demonstrating this step

You can execute this snippet by inserting it into the execution template found here.

  

# Create a reference to the CIM_WiFiEndpoint instance.

$wifiEndpointRef =$wsmanConnectionObject.NewReference("SELECT * FROM CIM_WiFiEndpoint WHERE Name='WiFi Endpoint 0'")

$elementSettingDataRef =$wsmanConnectionObject.NewReference("CIM_ElementSettingData")

$elementSettingDataRef.AddSelector("ManagedElement",$wifiEndpointRef)

# Traverse to the CIM_ElementSettingData instances that are connected to the CIM_WiFiEndpoint instance.

foreach($elementSettingDataItem in$elementSettingDataRef.Enumerate("http://schemas.dmtf.org/wbem/wsman/1/wsman/SelectorFilter",$null))

{

    # For each instance, check if it is associated to the CIM_WiFiEndpointSetting instance.

if($elementSettingDataItem.Object.GetProperty("SettingData").IsA("CIM_WiFiEndpointSettings"))

    {

          $isCurrent =$elementSettingDataItem.Object.GetProperty("IsCurrent")

          if($isCurrent -like "1")

          {

                # Get the CIM_WiFiEndpointSettings object using its EPR.

                $wifiEndpointSettingsInstance =$elementSettingDataItem.Object.GetProperty("SettingData").Ref.Get()

          }

    }

}

 

 

Instance Diagram

Classes Used in This Flow

SDK Sample

Not applicable

 

See Also:

   Wireless Profile Parameters

Copyright © 2006-2022, Intel Corporation. All rights reserved.