Import-Module ActiveDirectory
Import-Module RemoteAccess
$user='user'
$group='vpn-users'
$server='vpn.domain.local'
#[string]$filter='"*'+$user+'*"'
Remove-ADGroupMember -Members $user -Identity $group -Confirm:$false
Get-RemoteAccessConnectionStatistics -ComputerName $server | ? UserName -like "*$user*" | Disconnect-VpnUser -ComputerName $server
Import-Module RemoteAccess
$user='user'
$group='vpn-users'
$server='vpn.domain.local'
#[string]$filter='"*'+$user+'*"'
Remove-ADGroupMember -Members $user -Identity $group -Confirm:$false
Get-RemoteAccessConnectionStatistics -ComputerName $server | ? UserName -like "*$user*" | Disconnect-VpnUser -ComputerName $server
Комментариев нет:
Отправить комментарий