strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set SessionSet = objWMIService.ExecQuery("Select * from Win32_ServerSession")
Set WshShell = CreateObject("WScript.Shell")
For Each Session in SessionSet
If (Session.IdleTime \ 60) > 10 Then
Set oExec = WshShell.exec("NET Session \\" & Session.ComputerName & " /Delete /y")
MsgBox Session.ComputerName & "'s connection was terminated."
End if
Next