parental-control/client/block.ps1

9 lines
257 B
PowerShell
Raw Permalink Normal View History

2023-09-09 10:41:07 +02:00
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
}