title: Get Current user's Workstation name logged into Host computer
body: <p>I have a host machine running windows-7 and users from the home network login using windows remote desktop connection  and run some applications ,
  I can visually see the log of who logged in under </p>
  
  <pre><code>Event Viewer-&gt;Windows Logs-&gt;Security-&gt;Audit Success-&gt;Details-&gt;Workstation name
  </code></pre>
  
  <p>Since only one connection is allowed using Remote Desktop connection, I want to display in an access database who the current user is, from the audit trail so users know if anyone is currently using the Host machine</p>
  
  <p>So basically a VBA code to grab the most recent workstation that logged in, specially I am interested in Event ID-4624</p>
  
  <p>I am open for other suggestions!</p>
  
  <p><strong>what I have tried so far?</strong></p>
  
  <pre><code>Function Reachable(strComputer) As String  'Test Connectivty to computer
  'On Error Resume Next
  Set objSWbemLocator = CreateObject("WbemScripting.SWbemLocator")
  Set objWMIService = objSWbemLocator.ConnectServer(strComputer, "root\cimv2", "username", "password")
  
  Set colItems = objWMIService.ExecQuery _
      ("Select * from Win32_NetworkLoginProfile")
  
  For Each objItem In colItems
      Reachable = "Full Name: " &amp; objItem.FullName
  
  Next
  End Function
  </code></pre>