Wednesday, June 18, 2008

View running process from command line in Vista/2008

tasklist /svc

Sample output:

Image Name PID Services
============================================
System Idle Process 0 N/A
System 4 N/A
smss.exe 520 N/A
csrss.exe 588 N/A
wininit.exe 632 N/A
csrss.exe 644 N/A
services.exe 676 N/A
lsass.exe 688 KeyIso, SamSs
lsm.exe 696 N/A
winlogon.exe 816 N/A
svchost.exe 892 DcomLaunch, PlugPlay
ibmpmsvc.exe 972 IBMPMSVC
svchost.exe 1040 RpcSs
svchost.exe 1100 WinDefend
svchost.exe 1172 Audiosrv, Dhcp, Eventlog, lmhosts, wscsvc
svchost.exe 1200 AudioEndpointBuilder, CscService, EMDMgmt,
hidserv, Netman, PcaSvc, SysMain,
TabletInputService, TrkWks, UxSms,
WdiSystemHost, Wlansvc, WPDBusEnum, wudfsvc
svchost.exe 1248 AeLookupSvc, BITS, Browser, EapHost,
IKEEXT, iphlpsvc, LanmanServer, MMCSS,
ProfSvc, RasMan, Schedule, seclogon, SENS,
ShellHWDetection, Themes, Winmgmt, wuauserv

Monday, June 09, 2008

Reset TS Sessions

I like to use this to prevent the dreaded "The Terminal server has exceeded maximum number of allowed connections". Call it in the wee hours of the morning via Scheduled Tasks.

REM Reset TS sessions
REM http://ts.veranoest.net/ts_faq.htm

for /f "tokens=2" %%i in ('qwinsta ^| find /i "listen"') do echo y | rwinsta %%i
change logon /enable

Wednesday, June 04, 2008

Report files older (ie modified) than a certain date

' FilesMod.vbs
' Reports files older (ie modified) than a certain date
' The date below shows files older than 25 Dec 2006

strDate = "20061225000000.000000+000"

strComputer = "."
Set objWMIService = GetObject _
("winmgmts:\\" & strComputer & "\root\cimv2")
Set colFiles = objWMIService.ExecQuery _
("Select * From CIM_DataFile Where LastModified < '" & strDate & "'") For Each objFile in colFiles Wscript.Echo objFile.Name Next

More...

Labels: