你必須自己用PowerShell去寫一個登入/登出的腳本
User登入AD時檢查如果已經在其他裝置登入則將其強制登出
之前有寫過以下POWERSHELL
$username = $env:USERNAME
$computers = Get-ADComputer -Filter * | Select-Object -ExpandProperty Name
$loggedIn = $false
$sessionId = $null
foreach ($computer in $computers) {
$sessions = query user /server:$computer 2>&1
foreach ($session in $sessions) {
if ($session -match "\s+$username\s+") {
$loggedIn = $true
$sessionId = $session.Split(" ")[2]
break
}
}
if ($loggedIn) { break }
}
if ($loggedIn) {
Write-Host "用戶 $username 在 $computer 上已登入,強制登出..."
logoff $sessionId /server:$computer
exit 0
} else {
exit 0
}
可是改來改去都不成, 放棄了