Log off disconnected users from a servers
Knowledge Base - How To
command to use in powershell
query user /server:$localhost 2>&1 | select -skip 1 | ? {($_ -split "\s+")[-5] -eq 'Disc'} | % {logoff ($_ -split "\s+")[-6] /server:$localhost /V}
command to use in powershell
query user /server:$localhost 2>&1 | select -skip 1 | ? {($_ -split "\s+")[-5] -eq 'Disc'} | % {logoff ($_ -split "\s+")[-6] /server:$localhost /V}