Win32 platform, win2ksvr, xmail 1.21, grep for windows installed so
that the email will have a code in it and proceed if code is there.

I took a long rest and came back to it... I have it sorta working.

Im going to lay it out and hopefully everyone will understand and comment:

pcreboot.cmd:

@echo off
if "%~1"=="" exit 0
if not exist "%~1" exit 0
set /a maxfileSize=2048
if /i %~z1 GTR %maxfileSize% exit 0
grep "55555" %~1
if not %ERRORLEVEL%==0 exit 0
shutdown.exe \\computername /R /T:05 /C
exit 0

filters.in.tab:

"[EMAIL PROTECTED]"[tab]"[EMAIL 
PROTECTED]"[tab]"0.0.0.0/0"[tab]0.0.0.0/0"[tab]"reboot.tab"

/filters/reboot.tab file:

"cmd.exe /c D:\Xmail\xmail_filters\pcreboot.cmd"[tab]"@@FILE"[tab]"@@RCPT"



All of that works if I replace the shutdown line with net send.
I tested it and if I use the netsend command all goes well, then I
want to run the actual command of shutdown and it never does anything.

I checked the event viewer in win2k and get this:

The description for Event ID ( 0 ) in Source ( XMail ) cannot be
found. The local computer may not have the necessary registry
information or message DLL files to display messages from a remote
computer. You may be able to use the /AUXSOURCE= flag to retrieve this
description; see Help and Support for details. The following
information is part of the event: Filter error (-5): Sender =
"[EMAIL PROTECTED]" Recipient = "[EMAIL PROTECTED]" Filter
= "cmd.exe /c D:\Xmail\xmail_filters\pcreboot.cmd"


The whole reason for this is that sometimes one of our database
servers needs to be rebooted and when I am in the office I do it. In
the event that I am not in the office I thought it would be a good
idea to have a way to reboot it from my cellphone or have one user in
the office be able to email to it and have it reboot.

This is easier to me than granting a certain user in the office server
admin rights.
I am open to suggestions

On 4/2/06, Filip Supera <[EMAIL PROTECTED]> wrote:
> waassssuu pppp a écrit :
> > Oh crap that grep has to be compiled on windows.. I dont think I will
> > succeed at that. I dont have the tools needed.
> >
> > Cant i used the find command some kinda way?
>
> Now your writing to me, not to the list. I had not posted my answers to
> the list but personnaly... You seem to be a bit frazzled, aren't you ?
> Take a bit of rest :-)
>
-
To unsubscribe from this list: send the line "unsubscribe xmail" in
the body of a message to [EMAIL PROTECTED]
For general help: send the line "help" in the body of a message to
[EMAIL PROTECTED]

Reply via email to