![]() We only want the username so we will have to have to use our handy dandy FOR loop to parse it ( Episode 48). A space between search terms is treated as a logical OR.Ĭ:\> qwinsta /server:Alpha | findstr "Active Disc"Ĭ:\> qwinsta /server:Omega | findstr "Active Disc" By using the findstr command we can search for an active or disconnected session. We don't care about the listening sessions so we can filter the results for active and disconnected sessions. Curly is the only user logged to Omega, and is logged via the console. Server Alpha has two connections, one from Larry (connected) and Moe (disconnected). Shown above are two servers, Alpha and Omega. SESSIONNAME USERNAME ID STATE TYPE DEVICE Second, the username is the first item, and we all know that parsing text from the Windows command line is a pain. First, it only displays active and disconnected sessions instead of listeners. Too bad, since quser would have been a better fit for two reasons. The problem is, quser is NOT included in Windows XP so we will use qwinsta for compatibility. ![]() USERNAME SESSIONNAME ID STATE IDLE TIME LOGON TIME Both commands can be used to find out who is logged in locally and both accept the /server option to query another server. Windows has two commands to help us out, quser and qwinsta (short for Query WINdows STAtion). And there may be quite a few users, especially in the Windows world of Terminal Services. The problem is we don't know who is logged in. Users have to be notified before taking it offline. So it has happened to all of us, a server needs to be taken down for some reason or another, but you can't just yank it out of production. Tim's also got his own blog over at, where he's lately been throwing down some Powershell solutions to our earlier Episodes. ![]() Ed is currently auditioning for the coveted title role in "Where in the World is Carmen San Diego?" So in the meantime we've invited Sifu Tim Medin to bring the Windows madness to the Command Line Kung Fu dojo.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |