fireburn11
asked on
vbscript to run dcdiag and only send error/failed event to me
Hi All,
I am in need of a vbscript to run dcdiag, look into the result and if there is any error/failed event, send the result to me. if no error/failed found, dont send.
Thanks in advance for your help!
I am in need of a vbscript to run dcdiag, look into the result and if there is any error/failed event, send the result to me. if no error/failed found, dont send.
Thanks in advance for your help!
Sorry - on line 19 change "passed" to "fail" (I had set it to "passed" for testing to make sure the email was getting sent)
ASKER
hi TheGorby, I dont know what the autoit is... sorry.
I have a script to do this, but like everyone else I use something other than VbScript to do it. Mine is PowerShell, any use?
Chris
Chris
If you're interested in AutoIT at all, it's basically a simplified programming language that comes with its own compiler to make an executable. What you would do is download AutoIT and install it on any computer. Copy and paste the script I posted into the Scite script editor that comes with AutoIT, and then go to the Tools menu to compile the script into an EXE. You'd then have an EXE that can be run from any Windows computer regardless of whether AutoIT is installed on it or not.
ASKER
Hi Chris,
sure, powershell is fine. Thanks
sure, powershell is fine. Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I've created a simple .bat file to do my dcdiags for me.
Output is sent to a file and then open notepad with the list of tests that failed.
Not as fancy as the rest of the work done here, but gives me the same results.
Just stack the commands with the other names of the servers.
Output is sent to a file and then open notepad with the list of tests that failed.
Not as fancy as the rest of the work done here, but gives me the same results.
Just stack the commands with the other names of the servers.
@echo off
echo "************************************" >dcoutput.txt
echo "Active Directory Daily DCdiag checks" >>dcoutput.txt
date /T >>dcoutput.txt >>dcoutput.txt
time /T >>dcoutput.txt >>dcoutput.txt
echo "************************************" >>dcoutput.txt
dcdiag /s:DCNAME | find /I "failed" >>dcoutput.txt
copy c:\code\bat\dcoutput.txt c:\code\bat\results\dcdiag-%date:~3,2%-%date:~0,2%-%date:~6,4%.txt
AutoIT: http://www.autoitscript.com/site/autoit/downloads/
Open in new window