Table of Contents

Class WindowsFirewallRule

Namespace
CENTREL.XIA.Configuration.Types
Assembly
CENTREL.XIA.Configuration.Types.dll

Represents a Windows firewall rule configured on a Windows machine.

public class WindowsFirewallRule : GlobalSerializableClassicBase, IComparable<WindowsFirewallRule>
Inheritance
WindowsFirewallRule
Implements

Constructors

WindowsFirewallRule()

Initializes a new instance of the CENTREL.XIA.Configuration.Types.WindowsFirewallRule class.

public WindowsFirewallRule()

Properties

Action

Gets or sets the action of the rule.

public WindowsFirewallRuleAction Action { get; set; }

Property Value

WindowsFirewallRuleAction

ActionString

Gets the action of the rule as a human readable string.

public string ActionString { get; set; }

Property Value

string

ApplicationName

Gets or sets the application to which this rule applies.

public string ApplicationName { get; set; }

Property Value

string

ApplicationNameString

Gets the application to which this rule applies.

public string ApplicationNameString { get; set; }

Property Value

string

CollectionIndex

Gets the index of the item when used by the data comparer. When scanned using PowerShell, the instance identifier of the rule is used, otherwise the identifier is generated.

public string CollectionIndex { get; }

Property Value

string

Description

Gets or sets the description of the rule - for example "Inbound rule to allow Asynchronous WMI traffic for remote Windows Management Instrumentation".

public string Description { get; set; }

Property Value

string

Direction

Gets or sets the direction of the rule - Inbound or Outbound.

public WindowsFirewallRuleDirection Direction { get; set; }

Property Value

WindowsFirewallRuleDirection

DirectionString

Gets the direction of the rule as a human readable string - "Unknown," "Inbound" or "Outbound".

public string DirectionString { get; set; }

Property Value

string

DuplicateNameOffset

Gets or sets the duplicate name offset. Used by the data comparer.

public int DuplicateNameOffset { get; set; }

Property Value

int

Enabled

Gets or sets whether the rule is enabled.

public BooleanOption Enabled { get; set; }

Property Value

BooleanOption

Identifier

Gets or sets a unique identifier for the rule. This is used internally only.

public Guid Identifier { get; set; }

Property Value

Guid

InstanceId

Gets or sets the instance identifier of the rule. This is only available when the information was collected using PowerShell remoting.

public string InstanceId { get; set; }

Property Value

string

LocalAddresses

Gets or sets the local addresses to which this rule applies.

public SerializableStringCollection LocalAddresses { get; set; }

Property Value

SerializableStringCollection

LocalAddressesString

Gets or sets the local addresses to which this rule applies as a human readable string.

public string LocalAddressesString { get; }

Property Value

string

LocalPorts

Gets or sets the local ports to which this rule applies.

public SerializableStringCollection LocalPorts { get; set; }

Property Value

SerializableStringCollection

LocalPortsString

Gets the local ports as a human readable string.

public string LocalPortsString { get; }

Property Value

string

Name

Gets or sets the rule name.

public string Name { get; set; }

Property Value

string

OverrideBlockRules

Gets or sets whether to override block rules.

public BooleanOption OverrideBlockRules { get; set; }

Property Value

BooleanOption

ProfileNames

Gets or sets the names of the profiles to which this rule applies as a human readable string in CSV format.

public string ProfileNames { get; set; }

Property Value

string

Profiles

Gets or sets the the profiles to which this rule applies.

public WindowsFirewallRuleProfileTypes Profiles { get; set; }

Property Value

WindowsFirewallRuleProfileTypes

ProtocolString

Gets the name of the protocol specified for this rule.

public string ProtocolString { get; set; }

Property Value

string

RemoteAddresses

Gets or sets the remote addresses to which this rule applies.

public SerializableStringCollection RemoteAddresses { get; set; }

Property Value

SerializableStringCollection

RemoteAddressesString

Gets or sets the remote addresses to which this rule applies as a human readable string.

public string RemoteAddressesString { get; }

Property Value

string

RemotePorts

Gets or sets the remote ports to which this rule applies.

public SerializableStringCollection RemotePorts { get; set; }

Property Value

SerializableStringCollection

RemotePortsString

Gets the remote ports as a human readable string.

public string RemotePortsString { get; }

Property Value

string

RuleIndentifier

Gets the identifier for this rule. This may yield duplciates so is combined with the duplicate offset to give a truely unique.

[Browsable(false)]
public string RuleIndentifier { get; }

Property Value

string

SecurityType

Gets or sets the security type.

public WindowsFirewallRuleSecurityType SecurityType { get; set; }

Property Value

WindowsFirewallRuleSecurityType

SecurityTypeString

Gets the security type.

public string SecurityTypeString { get; set; }

Property Value

string

SourceType

Gets or sets the source where the firewall rule is configured.

public WindowsFirewallSettingSourceType SourceType { get; set; }

Property Value

WindowsFirewallSettingSourceType

SourceTypeString

Gets the source where the firewall rule is configured as a human readable string.

public string SourceTypeString { get; set; }

Property Value

string

Methods

CompareTo(WindowsFirewallRule)

Compares two CENTREL.XIA.Configuration.Types.WindowsFirewallRule objects to allow sorting alphabetically by name.

public int CompareTo(WindowsFirewallRule other)

Parameters

other WindowsFirewallRule

The CENTREL.XIA.Configuration.Types.WindowsFirewallRule to compare to.

Returns

int

The sort order of the two items.

ResolveProtocolNumber(int)

Resolves the specified protocol number to the display name.

public static string ResolveProtocolNumber(int protocolNumber)

Parameters

protocolNumber int

The protocol number to resolve.

Returns

string

The display name of the protocol with the specified protocol number.