Disconnect-VpnUser
Disconnect-VpnUser
Disconnects a VPN connection originated by a specific user or originating from a specific client computer.
Sintaxis
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>]
Descripción detallada
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.
Parámetros
-AsJob
Alias |
ninguno |
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
false |
¿Aceptar caracteres comodín? |
false |
-CimSession<CimSession[]>
Ejecuta el cmdlet en una sesión remota o en un equipo remoto. Escriba un nombre de equipo o un objeto de sesión, como la salida de un cmdlet New-CimSession o Get-CimSession. El valor predeterminado es la sesión actual en el equipo local.
Alias |
Session |
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
false |
¿Aceptar caracteres comodín? |
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.
Alias |
Cn |
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
false |
¿Aceptar caracteres comodín? |
false |
-HostIPAddress<String[]>
Specifies the list of tunnel IP addresses of the VPN connection. These can be IPv4 or IPv6 addresses.
Alias |
ninguno |
¿Requerido? |
true |
¿Posición? |
named |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
True (ByPropertyName) |
¿Aceptar caracteres comodín? |
false |
-PassThru
Devuelve un objeto que representa el elemento con el que está trabajando. De forma predeterminada, este cmdlet no genera ningún resultado.
Alias |
ninguno |
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
false |
¿Aceptar caracteres comodín? |
false |
-ThrottleLimit<Int32>
Especifica el número máximo de operaciones simultáneas que se pueden establecer para ejecutar el cmdlet. Si se omite este parámetro o es especifica un valor de 0
, Windows PowerShell ® calcula un límite óptimo para el cmdlet en función del número de cmdlets de CIM que se estén ejecutando en el equipo. El límite solo se aplica al cmdlet actual, no a la sesión ni al equipo.
Alias |
ninguno |
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
false |
¿Aceptar caracteres comodín? |
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.
Alias |
ninguno |
¿Requerido? |
true |
¿Posición? |
2 |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
True (ByPropertyName) |
¿Aceptar caracteres comodín? |
false |
-Confirm
Solicita confirmación antes de ejecutar el cmdlet.
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
falso |
¿Aceptar canalización? |
false |
¿Aceptar caracteres comodín? |
false |
-WhatIf
Muestra lo que sucedería si se ejecutara el cmdlet. El cmdlet no se ejecuta.
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
falso |
¿Aceptar canalización? |
false |
¿Aceptar caracteres comodín? |
false |
<CommonParameters>
Este cmdlet admite los siguientes parámetros comunes: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer y -OutVariable. Para obtener más información, consulte about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).
Entradas
El tipo de entrada es el tipo de los objetos que se pueden canalizar al cmdlet.
- None
Salidas
El tipo de resultado es el tipo de objetos que emite el cmdlet.
System.String[]
The array of strings consists of the list of user names or host addresses of the connections that were disconnected.
Ejemplos
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