title: Copy .xml &.enc files from users' appdata remote machine to server location
body: <p>The situation is I need to grab all the .xml and .enc files from a list of remote machines' users' AppData profile folders.</p>
  
  <p>I thought this might be achieved the following way:</p>
  
  <ul>
  <li><p>Ping machine to determine if it is alive.</p></li>
  <li><p>If not, write the result to a log file so I can keep track of failed machines.</p></li>
  <li>If the machine is alive, run a vb script or xcopy script to grab the files and copy them to the server, ideally using that user's name as the remote folder location and copying the files into there.  So perhaps <code>C:\Users\John.Doe\AppData\Local\Dictation\Audio\*.xml</code> (and <code>*.enc</code>) to <code>\\Server\FolderBackup\John.Doe\</code>.</li>
  </ul>
  
  <p>The problem I ran into is I'm unable to get <code>xcopy</code> to copy files from a variable based location such as <code>%userprofile%\AppData\Local\dictation\audio</code> to the server so <code>xcopy</code> probably isn't the one to use.  I believe <code>robocopy</code> also suffers from this.  PowerShell may be the answer, but again I wouldn't know where to begin.</p>