title: Powershell -get-eventdata
body: <p>I am trying to create a script that pulls failed log on attempts for certain events in the past 24 hours but I cant figure out how to pull the account information out. User is Null all the time so info is blank BUT when I look in the general tab I can see "Account Information".</p>
  
  <p>I would like to pull and add what it shows in the XML view under "event data" which is TargetUserName. How can I get this done? What I have so far works fine but I need the username info and what my script pulls is always blank.</p>
  
  <p>System - windows server 2008 R2
  Log I am pulling from is security log with event ID's 4625,4768,4771,4772 for the past 24 hours.</p>
  
  <p>My code:</p>
  
  <p>get-eventlog Security 4625,4768,4771,4772 -after ((get-date).addDays(-1))| export-csv </p>