Wednesday, February 8, 2023

PowerShell: Script to logoff all sessions on a Windows computer

This PowerShell script allows you to force logoff all user sessions on a Windows computer:

quser | Select-Object -Skip 1 | ForEach-Object {
$id = ($_ -split '+')[-5]
logoff $id
}


No comments:

Post a Comment