Get-RemoteAccessConnectionStatistics

Get-RemoteAccessConnectionStatistics

Displays the statistics of real-time, currently active DirectAccess (DA) and VPN connections and the statistics of DA and VPN historical connections for a specified time duration.

構文

Parameter Set: ActiveStatistics
Get-RemoteAccessConnectionStatistics [-AsJob] [-CimSession <CimSession[]> ] [-ComputerName <String> ] [-ResourceName <String> ] [-RoutingDomain <String> ] [-ThrottleLimit <Int32> ] [ <CommonParameters>]

Parameter Set: AccountingStatistics
Get-RemoteAccessConnectionStatistics [[-StartDateTime] <DateTime> ] [[-EndDateTime] <DateTime> ] [-AsJob] [-CimSession <CimSession[]> ] [-ComputerName <String> ] [-ThrottleLimit <Int32> ] [ <CommonParameters>]

詳細説明

The Get-RemoteAccessConnectionStatistics cmdlet displays the statistics of the real-time, currently active DirectAccess (DA) and VPN connections and the statistics of DA and VPN historical connections for a specified time duration

The statistics for active and historical connections starting or ending on a Remote Access (RA) server are stored in the inbox accounting store on that server. This cmdlet retrieves statistics for a specific server. This cmdlet is not impacted by multi-site deployment.
-- If neither a start date nor an end date is specified, then statistics for active connections is retrieved.
-- In order to retrieve statistics of historical data, a time duration needs to be specified such as a start date, an end date, or both. If only one of them is specified then the time stamp on the first or last record in the accounting database is used to fill the missing information and to create a duration time.

The statistics of active connections can be explicitly filtered by the resource accessed over the connections or by the security group that users who originated the connections belong to. These filters are not available for statistics of historical connections.

パラメーター

-AsJob

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-CimSession<CimSession[]>

リモート セッションまたはリモート コンピューターでコマンドレットを実行します。New-CimSession コマンドレットや Get-CimSession コマンドレットの出力など、コンピューター名またはセッション オブジェクトを入力します。既定値は、ローカル コンピューターで実行中の現在のセッションです。

エイリアス

Session

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-ComputerName<String>

Specifies the IPv4 or IPv6 address, or host name, of the computer on which the RA server computer specific tasks should be run. When this parameter is specified, the statistics on the RA server are retrieved.

エイリアス

Cn

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-EndDateTime<DateTime>

Specifies the time duration for which the statistics of historical connections is to be retrieved and indicates the end date. If a date is not specified, then the time stamp of the last record in the accounting database is used by default.

エイリアス

なし

必須?

false

位置は?

3

既定値

Date stamp of last record

パイプライン入力を許可する

True (ByValue)

ワイルドカード文字を許可する

false

-ResourceName<String>

Enables a user to filter the statistics of active connections based on the server, or resource, that the end-user is accessing. This parameter indicates the IP address or host name of the server, or resource, that a user is accessing.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-RoutingDomain<String>

Specifies the name of the routing domain.

エイリアス

RoutingDomainName

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-StartDateTime<DateTime>

Specifies the time duration for which the statistics of historical connections is to be retrieved and indicates the start date. If a date is not specified, then the time stamp of the first record in the accounting database is used by default.

エイリアス

なし

必須?

false

位置は?

2

既定値

Date stamp of first record

パイプライン入力を許可する

True (ByValue)

ワイルドカード文字を許可する

false

-ThrottleLimit<Int32>

このコマンドレットを実行するために確立できる最大同時操作数を指定します。このパラメーターを省略するか、値として 0 を入力した場合、Windows PowerShell® では、コンピューターで実行している CIM コマンドレットの数に基づいて、コマンドレットに対する最適なスロットル制限を計算します。スロットル制限は現在のコマンドレットのみに適用され、セッションまたはコンピューターには適用されません。

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

<CommonParameters>

このコマンドレットは次の共通パラメーターをサポートします。-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer、-OutVariable.詳細については、以下を参照してください。 about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216)。

入力

入力型は、コマンドレットにパイプできるオブジェクトの型です。

  • None

出力

出力型は、コマンドレットによって生成されるオブジェクトの型です。

  • Microsoft.Management.Infrastructure.CimInstance#RemoteAccessConnection[]

    Microsoft.Management.Infrastructure.CimInstance オブジェクトは、Windows Management Instrumentation (WMI) オブジェクトを表示するラッパー クラスです。シャープ記号 (#) の後のパスは、基になる WMI オブジェクトの名前空間とクラス名です。
    For real-time statistics, the array of RemoteAccessConnection objects consists of the following properties. A separate instance of the object is output for every connection.
    -- The user name of the user logged in.
    -- The state of user activity on the connection, idle or active.
    -- The bandwidth used by the connection.
    -- The IPv4 address of the client computer.
    -- The IPv6 address of the client computer.
    -- The host name of the client computer.
    -- The internet-facing IP address of the client.
    -- The tunnel type: VPN tunnel or ESP tunnel for DA.
    -- The transition technology used in the DA connection: native IPv6, Teredo, IPHTTPS, Isatap, 6to4.
    -- The time stamp when the connection was setup.
    -- The time duration of connection.
    -- The total number of bytes received on the connection so far.
    -- The total number of bytes sent on the connection so far.
    -- The connection type: DA or VPN.
    -- The health status: Indicates the NAP health status.
    -- The authentication method used to authenticate the user and computer in VPN and DA.
    For accounting statistics, the array of RemoteAccessConnection objects consists of the following properties. A separate instance of the object is outputted for every connection.
    -- The user name of the user logged in.
    -- The IPv4 address of the client computer.
    -- The IPv6 address of the client computer.
    -- The host name of the client computer.
    -- The internet-facing IP address of the client.
    -- The tunnel type: VPN tunnel or ESP tunnel for DA.
    -- The transition technology used in the DA connection: native IPv6, Teredo, IPHTTPS, Isatap, 6to4.
    -- The time stamp when the connection was setup.
    -- The time duration of connection.
    -- The total number of bytes received on the connection so far.
    -- The total number of bytes sent on the connection so far.
    -- The connection type: DA or VPN.
    -- The health status: Indicates the NAP health status.
    -- The authentication method used to authenticate the user and computer in VPN and DA.

EXAMPLE 1

This example disconnects the connection by specifying the IP address of the host from which it originates. The output of the disconnect cmdlet displays the IP address of the disconnected host. For this example there is one active VPN connection. The output of this cmdlet is piped to the Format-List cmdlet to display the details of the active connection in a list format.

PS C:\> Get-RemoteAccessConnectionStatistics | Format-List –Property *
PS C:\> Disconnect-VpnUser -HostIPAddress 10.1.1.11 -PassThru10.1.1.11
PS C:\> Get-RemoteAccessConnectionStatistics | Format-List –Property *

EXAMPLE 2

This example gets a list of historic connections and export them to a .csv file.

A start and an end date boundaries are first established for the required data using the Get-Date cmdlet.

PS C:\> $startdate = Get-Date –Date "12/16/2011"
PS C:\> $enddate = Get-Date –Date "12/23/2011"

This cmdlet gets all of the connections made between start and end date and pipes it into the Export-Csv cmdlet to generate a .csv file.

PS C:\> Get-RemoteAccessConnectionStatistics –StartDateTime $startdate –EndDateTime $enddate | Export-Csv –Path "data.csv"

EXAMPLE 3

This example exports a list of historic connections up to a specific date.

PS C:\> $enddate = Get-Date –Date "12/23/2011"

The data is exported from server start date to the specified end date. Note: The starting date does not need to be explicitly specified here.

PS C:\> Get-RemoteAccessConnectionStatistics –EndDateTime $enddate | Export-Csv –Path "data.csv"

関連トピック

Get-RemoteAccessConnectionStatisticsSummary

Export-Csv

Format-List

Get-Date