Friday, December 24, 2010

Logoff remote desktop sessions via CMD

To List the session in remote server we use quser.exe

Display information about users logged on to the system.

QUSER [username sessionname sessionid] [/SERVER:servername]

username Identifies the username.
sessionname Identifies the session named sessionname.
sessionid Identifies the session with ID sessionid.
/SERVER:servername The server to be queried (default is current).

Example:

C:>quser /server:CONCHNDATP001

USERNAME SESSIONNAME ID STATE IDLE TIME LOGON TIME
A-BalaK ica-tcp#966 10 Active 7 12/25/2010 3:04 PM
GBala ica-tcp#969 1 Active 9 12/25/2010 3:30 PM
Admin ica-tcp#984 5 Active 1:06 12/25/2010 4:33 PM
Finance ica-tcp#987 2 Active 4 12/25/2010 6:20 PM

Logoff the Remote Sessions

To Log off the terminal session of the remote server, Before you log off the remote session, you should know the "Session ID" which you get it from "QUSER" commands as above stated.

1. Logoff
Logoff command kicks off (logging off) the specified remote session. Log off help shows,

C:>logoff /?
Terminates a session.

LOGOFF [sessionname sessionid] [/SERVER:servername] [/V]

sessionname The name of the session.
sessionid The ID of the session.
/SERVER:servername Specifies the Terminal server containing the user
session to log off (default is current).
/V Displays information about the actions performed.


E.g.,

C:>logoff 2 /server:CONCHNDATP001 /v
Logging off session ID 2



Wednesday, December 22, 2010

Microsoft KB Search Scripts

Copy the Below Script and Paste it into Notepad save it as KB.VBS

-----------------------------------------------------------------------------
Option Explicit

Dim oShell, sKBArticle

Set oShell = CreateObject("WScript.Shell")
sKBArticle = InputBox("Enter a 6-digit Microsoft KnowledgeBase article number:")
If NOT Len(sKBArticle) = 6 Then
MsgBox "Invalid KB article number!", 16, "Error"
Set oShell = Nothing
WScript.Quit
Else
oShell.Run "http://support.microsoft.com/?kbid=" & sKBArticle
End If

Set oShell = Nothing
WScript.Quit
------------------------------------------------------------------------------