Partager via


Win32_Proxy class

The Win32_Proxy WMI class contains properties and methods to query and configure an Internet connection related to Windows Product Activation (WPA).

The following syntax is simplified from MOF code and includes all of the inherited properties, but excludes methods. For reference information about methods, see the table of methods later in this topic.

Syntax

class Win32_Proxy : CIM_Setting
{
  string Caption;
  string Description;
  string ProxyPortNumber;
  string ProxyServer;
  string ServerName;
  string SettingID;
};

Members

The Win32_Proxy class has these types of members:

Methods

The Win32_Proxy class has these methods.

Method Description
SetProxySetting Creates a persistent Internet connection for WPA using a specified address and port number.

Properties

The Win32_Proxy class has these properties.

Caption

Data type: string

Access type: Read-only

Qualifiers: MaxLen (64)

Short textual description of the CIM_Setting object. This property is inherited from CIM_Setting.

Description

Data type: string

Access type: Read-only

Textual description of the CIM_Setting object. This property is inherited from CIM_Setting.

ProxyPortNumber

Data type: string

Access type: Read-only

Qualifiers: MaxLen (1024)

Port number configured on the computer for access to the proxy server specified by the ProxyServer property.

ProxyServer

Data type: string

Access type: Read-only

Qualifiers: MaxLen (1024)

Name of the proxy server configured for the user.

ServerName

Data type: string

Access type: Read-only

Qualifiers: MaxLen (1024)

Name of the computer whose proxy settings are to be accessed.

SettingID

Data type: string

Access type: Read-only

Qualifiers: MaxLen (256)

Identifier by which the CIM_Setting object is known. This property is inherited from CIM_Setting.

Remarks

The Win32_Proxy class is derived from CIM_Setting.

Note

Windows Product Activation is not available on the Itanium-based versions of the Windows operating system.

Examples

The following VBScript code sample displays the property information from a Win32_Proxy object.

On Error Resume Next

Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20

arrComputers = Array("\localhost")
For Each strComputer In arrComputers
   WScript.Echo
   WScript.Echo "=========================================="
   WScript.Echo "Computer: " & strComputer
   WScript.Echo "=========================================="

   Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
   Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_Proxy", "WQL", _
                                          wbemFlagReturnImmediately + wbemFlagForwardOnly)

   For Each objItem In colItems
      WScript.Echo "Caption: " & objItem.Caption
      WScript.Echo "Description: " & objItem.Description
      WScript.Echo "ProxyPortNumber: " & objItem.ProxyPortNumber
      WScript.Echo "ProxyServer: " & objItem.ProxyServer
      WScript.Echo "ServerName: " & objItem.ServerName
      WScript.Echo "SettingID: " & objItem.SettingID
      WScript.Echo
   Next
Next

Requirements

Minimum supported client
Windows XP
Minimum supported server
Windows Server 2003
End of client support
Windows XP
End of server support
Windows Server 2003 R2
Namespace
Root\CIMV2
MOF
Licwmi.mof
DLL
Licwmi.dll

See also

Windows Product Activation Provider

Win32_WindowsProductActivation

Win32_ComputerSystemWindowsProductActivationSetting