1

I need to detect the state of the Exchange VSS Writer service on a given machine. The script will only be executed if Microsoft Exchange 2003, 2007, or 2010 is currently running.

Powershell Script execution is not a viable option, as the client environments may or may not have script execution enabled.

Currently, I capture the output of running this command:

cmd /C "vssadmin list writers | find "Microsoft Exchange Writer" | find "State"

and if the state is set, return true.

This is always return true, because the first find only returns a single line.

2
  • Basically I need to get trailing lines to "Microsoft Exchange Writer"... Anyone know any flags/options/regex so I can grab trailing lines in the Find command?
    – Joe
    Aug 1, 2012 at 18:34
  • I think this can be done with some combination of findstr instead of find. I am not currently finding any way to build a regex that spans multiple lines. Anyone have any clue on how to construct that?
    – Joe
    Aug 3, 2012 at 19:13

0

You must log in to answer this question.

Browse other questions tagged .