I need professional help!!



Hello,
First of all, let me state that I am not a coder, so if the answer
could be in layman's terms, that would be much more helpful.
I have been working on this little project that basically should
grab two words from the subject of an email (first word = command to be
processed, second word = servername), pass those as variables to a
batch file, have the batch file do it's magic, then send a return email
with the results of the commands. I have been working on this for a
week now, and can't seem to figure this out. Any and all help will be
GREATLY appreciated.

Here's what I have so far:
Ex. An email comes in, with the subject "IISRESET <servername>"

Then, an Outlook rule will recognize the word IISRESET and call this
vbs file:

--Outlook.vbs--

Set oSession = CreateObject("MAPI.Session")
oSession.Logon , , False, False, 0

Set oFolder = oSession.Inbox
Set oMessages = oFolder.Messages

Set Msg = oMessages.GetFirst

While Not Msg Is Nothing
If Msg.Unread = True Then
strSubject = Msg.Subject
arr = Split(myItem.Subject, " ")
strActionToTake = arr(0)
strServerToActOn = arr(1)
end If
Set Msg = oMessages.GetNext

Option Explicit
Const = Command
Command = "J:\IISResetBatchFiles\iisreset_test.bat"
Dim strPath
strPath = arr(0)
Dim Server
Server = arr(1)
Dim strRUN
strRUN = "%comspec% /c " & Command & " " & strPath & " " & Server
Dim objWSS
Set objWSS = CreateObject("WScript.Shell")
objWSS.Run strRUN, 0, True
Set objWSS = Nothing

Set WSW.run = CreateObject("WScript.Shell")
wsw.Run "J:\IISResetBatchFiles\iisreset_test.bat"

oSession.Logoff
Set oSession = Nothing

Wend

Now, the two variables mentioned above should be passed to the batch
file below:

--IISRESET_TEST.bat--

set command = %1
set server = %2
psexec.exe %1 -u ***\******* -p *********
echo "IISRESET" > "C:\iisreset.txt"
psservice %2 query iisadmin >> "C:\iisreset.txt"
psservice %2 query w3svc >> "C:\iisreset.txt"
psservice %2 query smtpsvc >> "C:\iisreset.txt"
bmail -s blah.blah.blah.com -t username@xxxxxxxxxxx -f
username@xxxxxxxxxxx -h -a "Internet Information Services Reset Output"
-m c:\iisreset.txt

This batch file should perform the first variable as a command (in this
case, IISRESET) and the second variable being the server. Once done,
bmail will send the results back to myself. I have this working
without the variables, but that means I have to create a seperate batch
file for each server. We have hundreds of servers, so this is not a
preferred way.
Please help!! Thank you.

.



Relevant Pages

  • Re: A required privilege is not held by the client
    ... >> and post backup commands within Veritas. ... Before any server is backed up, ... the batch files only contain an exit command. ... > which you run the batch file has insufficient privileges ...
    (microsoft.public.win2000.general)
  • Re: Rebooting W2K3 TS Server
    ... xnet reboot /y is the command to run in your batch file, ... > 842506 - You cannot use the tsshutdn command to restart a Windows ... > Server 2003-based terminal server ... >>>I need to reboot a W2K3 server with TS installed once in a week. ...
    (microsoft.public.windows.terminal_services)
  • Re: A required privilege is not held by the client
    ... >> which you run the batch file has insufficient privileges ... > file has only the exit command. ... that says something like "log on as a batch job". ...
    (microsoft.public.win2000.general)
  • Re: A required privilege is not held by the client
    ... >> files is being run is a Domain Admin account. ... >> file has only the exit command. ... I can log in locally and run the batch file. ...
    (microsoft.public.win2000.general)
  • Re: dcdiag - advertising errors on newley promoted domain controller
    ... Can you do the following on uksccmads01 ... The problem may actually have nothing to do with the new server but the ... From a command prompt try and see if you get any additional info ... Skipping site UK-CCM, this site is outside the scope ...
    (microsoft.public.windows.server.active_directory)