title: Create a batch script with cluster.exe for MS SQL Failover AOAG
body: <p>I want to create a batch script using cluster.exe</p>
  <p>My initial batch script(<strong>FAILOVER_TO_DRDB01.BAT</strong>) is:</p>
  <pre><code>ECHO ON
  cluster.exe node DRDB01 /status  -o  C:\FAILOVER_TO_DRDB01_LOG.txt
  </code></pre>
  <p>When I try to run it, there is no output created.</p>
  <p>My main goal is that it will output this:</p>
  <pre><code>Listing status for node 'DRDB01':
  
  Node           Node ID Status
  -------------- ------- ---------------------
  DRDB01               3 Joining
  </code></pre>
  <p>Once it sees that Status is <strong>Joining</strong>, it will run the following script:</p>
  <pre><code>net.exe stop clussvc  
  net.exe start clussvc /forcequorum  
  </code></pre>
  <p>And once it failover, it will run the script below:</p>
  <pre><code>cluster.exe node DRDB01 /prop nodeweight=1 /prop:NodeWeight /status
  cluster.exe node PDCDB01 /prop nodeweight=0 /prop:NodeWeight /status
  cluster.exe node PDCDB02 /prop nodeweight=0 /prop:NodeWeight /status
  </code></pre>