Disconnect-VpnUser

Disconnect-VpnUser

Disconnects a VPN connection originated by a specific user or originating from a specific client computer.

構文

Parameter Set: UserName
Disconnect-VpnUser [-UserName] <String[]> [-AsJob] [-CimSession <CimSession[]> ] [-ComputerName <String> ] [-PassThru] [-ThrottleLimit <Int32> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: HostIP
Disconnect-VpnUser -HostIPAddress <String[]> [-AsJob] [-CimSession <CimSession[]> ] [-ComputerName <String> ] [-PassThru] [-ThrottleLimit <Int32> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

詳細説明

The Disconnect-VpnUser cmdlet disconnects a VPN connection originated by a specific user or originating from a specific client computer.

The list of active VPN connections originating or ending on a VPN server is stored in the inbox accounting store on the server. Therefore, this cmdlet would have to be run on the server where the connection starts or ends to disconnect a user.

A VPN connection can be disconnected in one of the following two ways. Note: Only one of these methods can be used at a time.
-- By user name of the user who originated the connection.
-- By tunnel IP address assigned by the VPN server.

パラメーター

-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 Remote Access server computer specific tasks should be run. When this parameter is specified the cmdlet looks for the specified user or host IP on that Remote Access server.

エイリアス

Cn

必須?

false

位置は?

named

既定値

なし

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

false

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

false

-HostIPAddress<String[]>

Specifies the list of tunnel IP addresses of the VPN connection. These can be IPv4 or IPv6 addresses.

エイリアス

なし

必須?

true

位置は?

named

既定値

なし

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

True (ByPropertyName)

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

false

-PassThru

作業中の項目を表すオブジェクトを返します。既定では、このコマンドレットによる出力はありません。

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

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

false

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

false

-ThrottleLimit<Int32>

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

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

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

false

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

false

-UserName<String[]>

Specifies the list of users that need to be disconnected. The Remote Access login name of the user that is used may be a domain account. If the user is a domain account, then it can be specified in DOMAIN\USERNAME format otherwise it is specified as a normal string.

エイリアス

なし

必須?

true

位置は?

2

既定値

なし

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

True (ByPropertyName)

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

false

-Confirm

コマンドレットを実行する前に、ユーザーに確認を求めます。

必須?

false

位置は?

named

既定値

false

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

false

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

false

-WhatIf

コマンドレットを実行するとどのような結果になるかを表示します。コマンドレットは実行されません。

必須?

false

位置は?

named

既定値

false

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

false

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

false

<CommonParameters>

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

入力

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

  • None

出力

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

  • System.String[]

    The array of strings consists of the list of user names or host addresses of the connections that were disconnected.

EXAMPLE 1

This example disconnects a VPN connection by specifying the host address. There is one active VPN connection in this example.

The output of the Get-RemoteAccessConnectionStatistics cmdlet piped into the Format-List cmdlet displays the details of the active connection in a list format.

PS C:\> Get-RemoteAccessConnectionStatistics | Format-List

This cmdlet is used to disconnect the connection by specifying the IP address of the server from which it originates. The output of this cmdlet displays the IP address of the disconnected server.

PS C:\> Disconnect-VpnUser -HostIPAddress 40.1.1.11 -PassThru
PS C:\> Get-RemoteAccessConnectionStatistics | Format-List

関連トピック

Get-RemoteAccessConnectionStatistics

Format-List