title: using batch file to get active members of an AD group
body: <p>I am trying to create a batch file to run and check what members of an AD are active (have logged in within the last 90 days) I have begun but am stuck at a portion when trying to read the output and have that search each user... </p>
  
  <p>batch code:</p>
  
  <pre><code>@echo off
  cls
  set "Output=C:\GroupMembersOut\test.txt"
  net group ToolUsers /domain &gt;&gt; "%Output%"
  timeout /t 10
  </code></pre>
  
  <p>What I get back in the text file is this:</p>
  
  <pre><code>The request will be processed at a domain controller for domain ***.com.
  
  Group name     **************
  Comment        ******** ***********
  
  Members
  
  -------------------------------------------------------------------------------
  *********                *******                  *******                  
  *******                  *******                  *******                  
  *******                  *******                  *******                  
  *******                  *******                  *******                  
  *******                  *******                  *******                  
  *******                  *******                  *******                  
  *******                  *******                  *******                  
  *******                  *******                  *******                  
  *******                  *******                  *******                  
  *******                  *******                  *******                  
  *******                  *******                  *******                  
  ********                 ********                 ********                 
  The command completed successfully.
  </code></pre>
  
  <p><strong>*As a note per the comments, the first UserID is my admin ID which is longer than 7 characters, most Login IDs are 7 characters and the contractors have an 8 character length *</strong></p>
  
  <p>Which is what I want, but now I need a way to search each user in a <code>net user %user% /domain</code> type way so I can begin the next step of stripping the name of the user and the last login. thanks for any advice, as a side note if anyone can help I would also like to add an input box for the ADgroup (in this case ToolUsers) so I can use the tool in a better way other than editing the bat everytime I want to search a new group. but thats just a side thing and not required.</p>