parental-control/client/block.ps1
2024-11-19 20:29:33 +01:00

9 lines
257 B
PowerShell

Start-Sleep 1
C:\Windows\System32\net.exe user Marek /active:no
$session_id = ((C:\Windows\System32\quser.exe | Where-Object {$_ -match 'Marek' }) -split ' +')[2]
If ($session_id) {
logoff $session_id
Start-Sleep 1
shutdown /s /f /t 0
}