On 8/16/2005 12:44, Parvinder wrote:
> Please ignore my post regarding the switch. /computers
cname.... however,
> getting email thru a script will be great.
I personally use perl, which you can get from activestate.com. In the
past I used the Net::SMTP module to do the sending of mail but since then
I discovered MIME::Lite which has a simpler and less kludgey interface.
Basically, no matter what scripting language you use, you'll have to parse
the output of the w32tm command for machine name and the time offset or
whatever and stick those in variables. After that, build the the body of
the email by concatenating strings and the contents of your variables and
then send it.
Besides standard SMTP (direct connection to the mail server) you could use
MAPI, but I give that a wide berth

Presumably, the dialect of VB that
the WSH uses could do either but it probably leans towards MAPI.
Another way would be to parse the output of the command and write to a
temp plain text file, then use something to scrape that up as an
attachment, maybe a plain bat file that runs something like either the
postie or blat programs (just google to find those). At worst (and
simplest), just use a bat file to run w32tm and redirect output to temp
txt file, then using blat to mail the file as attachment. ...or even
"w32tm /... | blat -" to pipe output to input with no text file. This
simplest way would need error handling added, depends on how important
things are.
Either way, you would use the task scheduler to run your script at intervals.
~Jason
--