How to capture and deploy WLAN profiles.

Article:HOWTO9771  |  Created: 2009-02-18  |  Updated: 2009-02-18  |  Article URL http://www.symantec.com/docs/HOWTO9771
Article Type
How To



Question
As PCT is not able to capture WLAN profiles, how can this goal still be achieved?

Answer

The following method can be used on Windows XP Service Pack 2 and Service Pack 3.

 

 

Requirements for Service Pack 2:

 

1.    Download and install “Wireless LAN API (KB918997)” (http://www.microsoft.com/DOWNLOADS/details.aspx?familyid=52A43BAB-DC4E-413F-AC71-158EFD1ADA50&displaylang=en).  Installing this set of application programming interfaces (APIs) will enable you to create applications that can manage wireless LAN profiles and connectivity on Microsoft Windows XP Service Pack 2 (SP2) using the native wireless functionality in Windows, called Wireless Zero Configuration (WZC) service.

2.    Start the Wireless Zero Configuration service.

 

Requirements for Service pack 3:

 

1.    Even though the Wireless Zero Configuration service is set to Automatic, you may find that it is not running, so you will need to start it.

 

 

The tool that will allow you to obtain the WLAN profiles as well as deploy them to other machines is called WLAN.exe and is attached to this article.

 

 

WLAN.exe has the following command line parameters:

 

          EnumInterface(ei)

          GetInterfaceCapability(gic)

          QueryInterface(qi)

          SetRadioState(srs)

          GetDriverStatistics(gds)

          Scan(scan)

          GetBssList(gbs)

          GetVisibleNetworkList(gvl)

          SetProfile(sp)

          SaveTempProfile(stp)

          GetProfile(gp)

          DeleteProfile(dp)

          SetProfileList(spl)

          GetProfileList(gpl)

          Connect(conn)

          Disconnect(dc)

          Discover(disc)

          RegisterNotif(r)

          help(?)

 

 

Below is the description for each of those commands:

 

Command: EnumInterface(ei)

Description: Enumerate wireless interfaces and print the basic interface information.

Usage: EnumInterface(ei)

 

Command: GetInterfaceCapability(gic)

Description: Get the capability of an interface.

Usage: GetInterfaceCapability(gic) <interface GUID>

Remarks: Use EnumInterface (ei) command to get the GUID of an interface.

 

Command: QueryInterface(qi)

Description: Query the basic information of an interface.

Usage: QueryInterface(qi) <interface GUID>

Remarks: Use EnumInterface (ei) command to get the GUID of an interface.

 

Command: SetRadioState(srs)

Description: Set the software radio state.

Usage: SetRadioState(srs) <interface GUID> <on|off>

Remarks: Use EnumInterface (ei) command to get the GUID of an interface.

 

Command: GetDriverStatistics(gds)

Description: Get driver statistics.

Usage: GetDriverStatistics(gds) <interface GUID>

Remarks: Use EnumInterface (ei) command to get the GUID of an interface.

 

Command: Scan(scan)

Description: Scan for available wireless networks.

Usage: Scan(scan) <interface GUID>

Remarks: Use EnumInterface (ei) command to get the GUID of an interface.

 

Command: GetBssList(gbs)

Description: Get the list of BSS.

Usage: GetBssList(gbs) <interface GUID> [<SSID> <infrastructure(i)|adhoc(a)> <secure(s)|unsecure(u)>]

Remarks: Use EnumInterface (ei) command to get the GUID of an interface.

 

Command: GetVisibleNetworkList(gvl)

Description: Get the list of visible wireless networks.

Usage: GetVisibleNetworkList(gvl) <interface GUID>

Remarks: Use EnumInterface (ei) command to get the GUID of an interface.

 

Command: SetProfile(sp)

Description: Save a profile.

Usage: SetProfile(sp) <interface GUID> <profile XML file name>

Remarks: Use EnumInterface (ei) command to get the GUID of an interface.

 

Command: SaveTempProfile(stp)

Description: Save the temporary profile used for the current connection.

Usage: SaveTempProfile(stp) <interface GUID> <profile name>

Remarks: Use EnumInterface (ei) command to get the GUID of an interface.

 

Command: GetProfile(gp)

Description: Get the content of a saved profile.

Usage: GetProfile(gp) <interface GUID> <profile name>

Remarks: Use EnumInterface (ei) command to get the GUID of an interface.

 

Command: DeleteProfile(dp)

Description: Delete a saved profile.

Usage: DeleteProfile(dp) <interface GUID> <profile name>

Remarks: Use EnumInterface (ei) command to get the GUID of an interface.

 

Command: SetProfileList(spl)

Description: Set the preference order of saved profiles. The list must contain all profiles.

Usage: SetProfileList(spl) <interface GUID> <profile name>+

Remarks: Use EnumInterface (ei) command to get the GUID of an interface.

 

Command: GetProfileList(gpl)

Description: Get the list of saved profiles, in the preference order.

Usage: GetProfileList(gpl) <interface GUID>

Remarks: Use EnumInterface (ei) command to get the GUID of an interface.

 

Command: Connect(conn)

Description: Connect to a wireless network using a saved profile.

Usage: Connect(conn) <interface GUID> <SSID> <infrastructure(i)|adhoc(a)> <profile name>

Remarks: Use EnumInterface (ei) command to get the GUID of an interface.

 

Command: Disconnect(dc)

Description: Disconnect from the current network.

Usage: Disconnect(dc) <interface GUID>

Remarks: Use EnumInterface (ei) command to get the GUID of an interface.

 

Command: Discover(disc)

Description: Connect to a network without a saved profile. The WLAN service will discover the settings for connection.

Usage: Discover(disc) <interface GUID> <SSID> <infrastructure(i)|adhoc(a)> <secure(s)|unsecure(u)>

Remarks: Use EnumInterface (ei) command to get the GUID of an interface.

 

Command: RegisterNotif(r)

Description: Register ACM and MSM notifications.

Usage: RegisterNotif(r)

 

Command: help(?)

Description: Print this help message.

Usage: help(?) [<command>]

 

 

Here is a basic example of how you can use this tool, once the Wireless Zero Configuration service has been started.

 

Capture phase: 

1.    Enumerate Interfaces - wlan.exe ei

 

There are 1 interfaces in the system.

Interface 0:

GUID: 89762a5d-bc6b-4ac6-8cf3-b0462b2bafef

Intel(R) PRO/Wireless 3945ABG Network Connection - Teefer2 Miniport

State: "disconnected"

Command "ei" completed successfully.

 

2.    Get Profile List – wlan.exe gpl 89762a5d-bc6b-4ac6-8cf3-b0462b2bafef

 

There are 1 profiles on the interface.

          "Profile1"

Command "gpl" completed successfully.

 

3.    Get Profile (profile name is case sensitive) – wlan.exe gp Profile1

The return profile xml is:

<?xml version="1.0"?>

<WLANProfile xmlns="http://www.microsoft.com/networking/WLAN/profile/v1">

          <name>Profile1</name>

          <SSIDConfig>

                   <SSID>

                             <hex>574C414E2D445341444B</hex>

                             <name>Profile1</name>

                   </SSID>

          </SSIDConfig>

          <connectionType>ESS</connectionType>

          <MSM>

                   <security>

                             <authEncryption>

                                      <authentication>open</authentication>

                                       <encryption>WEP</encryption>

                                      <useOneX>false</useOneX>

                             </authEncryption>

                             <sharedKey>

                                      <keyType>networkKey</keyType>

                                      <protected>false</protected>                                   <keyMaterial>76A3DEC BA383180E8A18E4E522</keyMaterial>

                             </sharedKey>

                             <keyIndex>0</keyIndex>

                   </security>

          </MSM>

</WLANProfile>

Command "gp" completed successfully.

 

 

Deploy Phase (setting the profile): 

wlan.exe sp 89762a5d-bc6b-4ac6-8cf3-b0462b2bafef C:\Profile1.xml

 

 

Conclusion:

 

As you can see, this tool has man functions, and all of them can be scripted in order to allow you to develop an automated method of capturing and deploying WLAN profiles.


Attachments

WLAN.zip (80 kBytes)

Legacy ID



45629


Article URL http://www.symantec.com/docs/HOWTO9771


Terms of use for this information are found in Legal Notices