Tuesday, 16 November 2010

How to remotely list scheduled tasks

I had the need of getting all details of the scheduled tasks of our servers, I could use a lot of other complex ways, but I still prefer simplicity of batch:
1. Create a file with the hostnames of all the computers you need to check for the
scheduled tasks (tasks.txt):
hostname1
hostname2
hostnameX

2. Create a batch file with (tasks.bat):
del out.csv
echo "HostName","TaskName","Next Run Time","Status","Logon Mode","Last Run Time","Last Result","Author","Task To Run","Start In","Comment","Scheduled Task State","Idle Time","Power Management","Run As User","Delete Task If Not Rescheduled","Stop Task If Runs X Hours and X Mins","Schedule","Schedule Type","Start Time","Start Date","End Date","Days","Months","Repeat: Every","Repeat: Until: Time","Repeat: Until: Duration","Repeat: Stop If Still Running">> out.csv
FOR /F %%a in (tasks.txt) Do schtasks.exe /query /fo csv /s %%a /v | FIND "%%a" >> out.csv

3. Run the batch file with a user that have admin rights on the server, you will get a CSV that can be easily imported on Excel or a similar application.

Saturday, 13 November 2010

Ultimate boot CD for Windows in USB

Ultimate Boot CD for Windows is an indispensable tool when a system needs to be recovered. But when you have for instance a vĂ­rus on a computer, it's not easy to keep it up to date, because it runs on a CD that can only be updated when you write it. So it's much more flexible to have this tool on an USB pen, where I can write and update some files. There are some nice tools to make an ISO available on USB boot, I highly recommend these:
- WinSetupFromUSB - great but on Windows 7 x64 does not work well with UAC active, also supports install Windows from USB
- USB boot without BIOS support - this works great for me and can make a system boot even without USB boot support, by using an ISO that boots with USB support.

Additionally to this, I use Ketarin, a must have tool to keep virus definitions updated on the USB.