Archive for February, 2010

Tech Tip: Schtasks

I had a need at work the other day to gather a list of Windows Scheduled Tasks on a variety of servers and aggregate it into a common format.  What I found was that Windows already had this capability.

The SCHTASKS command in Windows allows you to access the Windows Scheduled Tasks and AT schedules from the command line and output that information into a common format that can be used in other programs.

Running SCHTASKS /help gives the following syntax help:

SCHTASKS /parameter [arguments] 

Description:
 Enables an administrator to create, delete, query, change, run and
 end scheduled tasks on a local or remote system. Replaces AT.exe.

Parameter List:
 /Create         Creates a new scheduled task.

 /Delete         Deletes the scheduled task(s).

 /Query          Displays all scheduled tasks.

 /Change         Changes the properties of scheduled task.

 /Run            Runs the scheduled task immediately.

 /End            Stops the currently running scheduled task.

 /?              Displays this help/usage.

Examples:
 SCHTASKS 
 SCHTASKS /?
 SCHTASKS /Run /?
 SCHTASKS /End /?
 SCHTASKS /Create /?
 SCHTASKS /Delete /?
 SCHTASKS /Query  /?
 SCHTASKS /Change /?

If we then look at SCHTASKS /Query /? we get the following syntax help:

SCHTASKS /Query [/S system [/U username [/P password]]] [/FO format]
 [/NH] [/V] [/?]

Description: 
 Enables an administrator to display the scheduled tasks on the
 local or remote system.

Parameter List:
 /S           system      Specifies the remote system to connect to.

 /U           username    Specifies the user context under
 which the command should execute.

 /P           password    Specifies the password for the given
 user context.

 /FO          format      Specifies the output format to be 
 displayed. Valid values: TABLE, LIST, CSV.

 /NH                      Specifies that the column header should not
 be displayed in the output.
 Valid only for TABLE and CSV formats.

 /V                       Specifies additional output to be 
 displayed.

 /?                       Displays this help/usage.

Examples:
 SCHTASKS /Query 
 SCHTASKS /Query /? 
 SCHTASKS /Query /S system /U user /P password
 SCHTASKS /Query /FO LIST /V /S system /U user /P password
 SCHTASKS /Query /FO TABLE /NH /V

We see that there are options for retrieving the list of tasks from a specific computer and in a format like CSV which can be imported into a program like Microsoft Excel.

For example, to query MACHINEA and produce a CSV output, the command would be:

SCHTASKS /QUERY /S MACHINEA /FO CSV /V

This would output the following:

"HostName","TaskName","Next Run Time","Status","Last Run Time","Last Result","Creator","Schedule"
,"Task To Run","Start In","Comment","Scheduled Task State","Scheduled Type","Start Time","Start D
ate","End Date","Days","Months","Run As User","Delete Task If Not Rescheduled","Stop Task If Runs
 X Hours and X Mins","Repeat: Every","Repeat: Until: Time","Repeat: Until: Duration","Repeat: Sto
p If Still Running","Idle Time","Power Management"
"MACHINEA","GoogleUpdateTaskMachineCore","At logon time","","22:46:10, 2/23/2010","0","tom","Run at user logon","C:\Program Files\Google\Update\GoogleUpdate.exe /c","N/A","Keeps your 
Google software up to date. If this task is disabled or stopped, your Google software will not be
 kept up to date, meaning security vulnerabilities that may arise cannot be fixed and features ma
y not work. This task uninstalls itself when the","Enabled","At logon time","At logon time","1/1/
1999","N/A","N/A","N/A","NT AUTHORITY\SYSTEM","Disabled","Disabled","Disabled","Disabled","Disabl
ed","Disabled","Disabled","Disabled"
"MACHINEA","GoogleUpdateTaskMachineCore","12:50:00, 2/24/2010","","22:46:10, 2/23/2010","0
","tom","At 12:50 PM every day, starting 1/15/2010","C:\Program Files\Google\Update\GoogleUpd
ate.exe /c","N/A","Keeps your Google software up to date. If this task is disabled or stopped, yo
ur Google software will not be kept up to date, meaning security vulnerabilities that may arise c
annot be fixed and features may not work. This task uninstalls itself when the","Enabled","Daily 
","12:50:00","1/15/2010","N/A","Everyday","N/A","NT AUTHORITY\SYSTEM","Disabled","Disabled","Disa
bled","Disabled","Disabled","Disabled","Disabled","Disabled"
"MACHINEA","GoogleUpdateTaskMachineUA","23:50:00, 2/23/2010","","22:50:00, 2/23/2010","0",
"tom","Every 1 hour(s) from 12:50 PM for 24 hour(s) every day, starting 1/15/2010","C:\Progra
m Files\Google\Update\GoogleUpdate.exe /ua /installsource scheduler","N/A","Keeps your Google sof
tware up to date. If this task is disabled or stopped, your Google software will not be kept up t
o date, meaning security vulnerabilities that may arise cannot be fixed and features may not work
. This task uninstalls itself when the","Enabled","Hourly ","12:50:00","1/15/2010","N/A","Everyda
y","N/A","NT AUTHORITY\SYSTEM","Disabled","Disabled","1 Hour(s)","None","24 Hour(s): 0 Minute(s)"
,"Disabled","Disabled","Disabled"

To send this into a file instead of the screen, you can use the redirection operator “>” with a filename “> filename.csv” to send the output to filename.csv which can then be opened in another program.

This helpful for a single server, but I did not want to have to type this for each server I wanted to query, so I wrote the following Powershell script to take a list of servers from a text file, query their tasks and then output it to a single file that I could reference later.

# Powershell Script to Query Remote Servers and Display Scheduled Tasks
# 2/18/2010 - Tom Determan

# Count and Display Number of Servers in Input FIle
$NUMSERVERS = (get-content d:\data\servers.txt | Measure-Object -property length -Line)
write-host "Number of Servers to Check: " $NUMSERVERS.Lines

set-variable -name COUNT -value 0

# Query Each Machine and Output CSV of Scheduled Tasks 
get-content d:\data\servers.txt | Foreach-Object {
 $COUNT=$COUNT+1
 set-variable -name SERVERNAME -value $_
 Write-Host "Checking Server: " $SERVERNAME " " $COUNT " of " $NUMSERVERS.Lines
 
 # For first line print column headings, other lines omit /NH option in schtasks
 if ($COUNT -eq 1) {schtasks /query /FO CSV /V /S $SERVERNAME | Out-File d:\data\output1.csv}
 else {schtasks /query /NH /FO CSV /V /S $SERVERNAME | Out-File -append d:\data\output1.csv}
}

# schtasks outputs blank line at beginning, go through and remove blank lines from final file
get-content d:\data\output1.csv | where {$_ -ne ""} > d:\data\output.csv
erase d:\data\output1.csv

If you find this useful feel free to use the script.  If you find a better way to accomplish what I set out to do, shoot me an email and let me know.  I was able to get this to work on Windows 2000 through Windows 2008 Servers.

Comments off

A Social Yahoo?

Looks like Yahoo wants to get into the Social Networking business again.  Yahoo News posted that Yahoo will be entering into an agreement with Twitter to allow users to link their Yahoo account information with Twitter.  While the article was short on specific details about the integration, it seems to me that Yahoo is still playing catch-up to Google and obviously is trying to compete with Google Buzz.

So what do all these announcements really mean?

If you look at the current state of the web and the web of the past, it was a collection of relatively disjointed sites.  You may have one site that you use for email, another for tracking notes/tasks/calendar, and possibly a number of sites for tracking your social network and connections to other people on the web.  What we are seeing now is that people are starting to have a desire to interface all of these different sites together to leverage the information from one common portal.  While the backend may still be multiple sites, there will be one location to go to to see all of your updates and possibly interface lists of disparate contacts together without having to add them to all of your websites.

This is the next wave of the web.   I want to see all of my information together.  I dislike the fact that I need to look at multiple websites to understand what is going on in my personal social network.

Comments off

Historical Olympic Stats at Sports Reference Website

Besides being passionate about technology, I also am a huge sports fan.  For the most part this means following the big four sports here in the United States, rooting for my favorite teams.  However, every two years, I become an Olympics junkie.  I will stay up late to watch events that I have no interest in the rest of the time.

I think sports fascinate because of the abundance of data around the sports.  Baseball has RBI and OBP, basketball has shot percentages and football has the famous QB Rating.  There is always some stat and some historical reference around that statistic that can be pondered.

Over the last couple of years, I have frequented the site Sports Reference for these historical statistics.  Perusing the baseball and football sections to reference current and past players performance and statistics.  Well, now I can do that for the Olympics also.

On the Sports Reference blog on Tuesday, they announced the addition of historical Olympic data.  Now I can find out that Larisa Latynina of the former Soviet Union is the top Olympic medal winner of all time with 18 medals won in Gymnastics at the Summer Olympics, or that Bjørn Dæhlie of Norway is the top Winter Olympics medal winner of all time with 12 in Cross Country Skiing.   All the data is there, going back to the early 1900s through the 2008 Beijing games.

For a stat junkie like myself, this is the best thing that could have come out during the Olympics.

Comments off

Programmer Barbie

Well, it looks as if Barbie will soon be celebrating all of the female geeks out there with their 2010 Computer Engineer Barbie complete with pink laptop. Based on an online vote that Barbie had, the Computer Engineer Barbie won out in the popular vote.

I hope this encourage young girls and women, like my daughter, to go into the science fields.  We need more women in these areas, and if a doll from Barbie can help ignite a passion within a girl that takes her into the field, I am all for it.  Ada Lovelace and Grace Hopper would be proud of this.

Click here to see a picture of the proposed doll.

Comments off

What’s All the Buzz

I seem to be on a Google theme this week, so might as well continue.  It seems that Google feels the need to try and challenge Facebook in the social networking site, with the release of Buzz within Gmail.  So you can follow other people that you currently exchange email with and wait for them to update yet another site with a status update.

I am not sure what to think about it at this point.  I have a Facebook, Twitter, Tumblr and probably other social networking accounts that I have forgotten about.  I am not sure I need another one.  Why not link the Gmail contacts with Facebook contacts instead of having another social network.  Most of the people that I want to follow I am already following in Facebook.

Is this a grand scheme by Google to really make a play in that space or is another “we can do this also” site that is destined to be remembered for a short while and then forgotten?  Or at the end of the day, is this just another avenue to sell me an add about some product I really do not need?

Comments (1)

Street View from the Slopes

Just in time for the Olympics, Google has released Street View for Olympic venues.  Browse the Street View gallery to see images of the actual Olympic facilities within the Vancouver area.

Comments off

More Google in Your Home

Google announced today on their blog that they will be rolling out a pilot program to bring broadband internet access to the house.  No longer just a web services company, but now also a web access provider?  I wonder what this will do to the broadband service industry.

Comments off

gPodder

I use a variety of computers and devices to access information on the web.  I have a home laptop, a netbook, a work laptop and an iPhone.  I tend to try and utilize cloud solutions when possible to keep certain pieces of information synced between the two.  One of these pieces of information is the list of Podcasts that I listen to on a regular basis.  For the most part this list is relatively static, but when I add a new Podcast that I want to listen to, I want that change to take effect everywhere.

This where gPodder comes into play.  gPodder is a free Podcast aggregator that runs on Windows, Linux and OS X.  I currently have Ubuntu running on my netbook and Windows 7 on my home laptop.  The installation on both were simple and straightforward.

Ubuntu

The Ubuntu repository contained the gPodder application, so it was as simple as utilizing a “apt-get install gpodder” to install and place in the “Sound & Video” menu on my Ubuntu installation.

Windows 7

The Windows version is distributed as a zip file, so the installation  was as simple as extracting the files into a directory and then double-clicking on the gpodder application in the extracted directory.

Both versions show a clean and intuitive interface, listing Podcasts on the left and the episodes available and downloaded on the right.  By default it will download the newest episodes, but downloading older episodes is as easy as right-clicking and choosing download.

Since I have an iPhone, I had primarily been using iTunes for my Podcast aggregation.  This works fine for the Windows laptop and my iPhone, but what if I wanted to have these same Podcasts available on my netbook.  I do not download all my subscribed Podcasts to the iPhone, leaving the video Podcasts to reside on the laptop only.  This is where gPodder really shines for me, as it allows me to keep my laptop and netbook and any device in sync.

The one feature of gPodder that drove me to using it, was the web service is provides to keep record of your Podcast subscriptions online and then allow you to set the client to use this web service to keep them in sync.  I created an account for myself at gPodder’s web service site which was simple and straightforward.

So, these were the steps that I took to get my Podcasts in sync between the two computers.

1. I exported the Podcasts from iTunes into a OPML file.

2. I imported the OPML file into one of my gPodder installations.

3. Uploaded it to the gPodder web service.

4. Told the other installation of gPodder to keep in sync with the web service.

That was it.  I now know that if I add a new subscription on my netbook, that gPodder will upload that subscription to my gPodder account and the next time I use the Windows client, it will be present. For someone like me who utilizes multiple devices this is a definite help to keeping another piece of my online life in sync.

Comments off

Hovering Above Twitter

I spend a lot of time in Twitter clicking on people who are following my updates or on people who have been Retweeted to see their profile and get more information on them.  This to me is a major buzzkill in Twitter, as it ruins the flow of seeing Tweets go by on the screen, because you now have to go to another screen and then go back and by that time your Tweetstreem has moved on from the point it was at.

Well, Twitter, must have had the same thought and announced yesterday that in any timeline, you will be able to place your mouse pointer on a Twitter username and when you “hover” over it, a “Hovercard” will appear giving you more information on the user.  I like this a lot.  This to me is a great enhancement to the site’s usefulness and I can not wait until it is completely rolled out.  Anytime you can provide more information in stream, not requiring the user to go to another screen, you keep the focus of the user.

Good job Twitter.

Comments off

Benefits of Offsite Backups

One of the most basic responsibilities within in any large IT organization is ensuring secure, regular and valid backups of the data that is important to the organization.

What once started out as being tape backups with a group of operators switching tapes and sending certain ones offsite, has over the years turned into terabytes of data on disk with offsite replication at remote sites.  And while a large organization can afford to have this type of infrastructure in place, what is the small mom and pop organization to do, or for that matter a home user?

Over the years, I have consulted to a number of small organizations on configuration and setup of their internal networks including the configuration of backup software and setting policy/procedure for ensuring that these backups happen on a regular basis and there is some sort of offsite storage of the data in case of a disaster.  In the beginning I would recommend that once a week, a backup tape be taken offsite and stored at the owner’s house or maybe at another location if the organization had more than one location.  But, as any of us who have been in this business knows, tape backup is not exactly the most reliable, and the due diligence was not always there to rotate the tapes properly or perform periodic restores to ensure the backups were valid. 

As the amount of data to be backed up grew, this became less feasible.  It was not unusual for a small company to still have 100s GB of data that needed to be backed up.  For some we configured a set of external hard drives that were rotated, but this was expensive and not always the most foolproof of designs.  Hard drives were forgotten, used more than one day in a row, or the person who took it home decided they needed to backup their own PC.  Some home users backup to DVDs or CDs, and then store these somewhere.

Today I avoid tape and external storage device backups.  For the a small monthly cost, there are a number of online companies that provide online storage and backup programs that allow you to specify what is backed up, when and how many versions to keep.  The data is sometimes stored on the company’s infrastructure, or they may utilize Rackspace or Amazon S3 for storage. 

What are the benefits from using an online backup facility:

  • No physical device to remember to manage.  Whether this is swapping/rotating tapes or external hard drives or a spare server used for backups.
  • All data is offsite, so in the case of a building disaster, you still have your data.
  • Remote access to data.  You can leverage the secure data access through the backup vendor instead of having to open holes in your firewall to your server and worrying about hackers.
  • Piece of mind that your data is safe.

Here are some of the companies that provide online backup services:

I encourage any of you out there that are still backing up to media that is in your home or business to utilize an online service before you realize that your financial data just went up with the building.

Comments off

« Previous entries Next Page » Next Page »

Get Adobe Flash player