How to derive computer name from entering user name into a csv file containing both sets of items? RRS feed

  • Question

  • I have a .csv file that has only 2 columns: UserName and MachineName. I need a script that will allow the importation of the .csv into an .hta,  which has an html form to enter the UserName, search and display the statically-assigned VDI MachineName associated with it. The UserName and the MachineName occupy the same line but are in separate cells. (This should be simple but all I can find are programs that derive the machine name from AD.)  The purpose of this is to to assist Tier 1 Service Desk personnel to rapidly acquire a client's computer name for inputting into MSRA and RDP.
    • Moved by jrv Wednesday, March 27, 2019 4:32 PM OF TOPIC
    Tuesday, March 26, 2019 3:30 PM

All replies

  • Sorry but this is not an HTA forum.  This forum is for PowerShell scripts only.

    HTAs are obsolete.  You can use Excel to edit CSV files.

    I recommend that you start by learning PowerShell which can be used to create GUI forms. 


    Tuesday, March 26, 2019 3:34 PM
  • You asked this same question 3 weeks ago.  


    Here is a snippet from what you posted in that thread:

    <form action="/sessions.csv">
      User name (Firstname dot Lastname):<br>
      <input type="text" name="$Username"><br>
      <input type="submit" value="Submit"><br>

    You cannot post a form back to a csv file. You cannot reference a Powershell variable like $username in this manner. That tells me that you do not have the basic programming skills needed to complete the task.

    You need to understand data types, variables, constructs like loops and condition testing, and how to do file I/O. Essentially, you need to write a small computer program to do the name lookup.  

    So again I will reply, go get some training. Take a computer programming class at a local school. Take an online course. Or find a programmer in your organization who can help you write this code.  

    • Proposed as answer by TheGhost82 Wednesday, March 27, 2019 1:36 PM
    Wednesday, March 27, 2019 12:56 AM