Username to Hostname Resolution

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello:

We have recently gone through a merger and a new hostname naming convention
has been implemented. Prior to the merger the user's username matched their
hostname. Sadly, the new naming conventions no longer have that correlation.
We went from hostnames being JohnD to now DEN55466. Is there an MS
command-line utility or perhaps a third party utility that would allow me to
type in the username, press enter and then the hostname would be displayed?

Thank you very much for your assistance.
 
As there is not a 1-1 correlation between user and machine I do not see how
such a tool would be designed.

It may be possible to query Active Directory to return a list of computers
the user is currently logged on to.

However to directly answer your question, to my knowledge no tool exists
that would match a username to a hostname.
 
Sorry I was misunderstood. Here's an example:

I get a phone call from a user saying that they're having a problem with
something on their system. Rather than having to visit the user or having
them obtain their own hostname I want to be able to use a command line tool
that would allow me to type in the users username then I press enter and 5 -
10 seconds later the hostname is provided to me. This is possible with GFI
Languard but I requires block of IP's to search through. Once I give it a
block of IP's I
then have to go through each host it found to eventually find the hostname of
the machine that my user is using. Does that make sense..? Let me know if
you
have any other ideas.
 
Here is an easy solution:

1. Insert the following line into the logon script:
echo %date% %time% %Computername% >> \\YourServer\SomeShare\%Username%.txt

2. When JSmith rings, you examine the last entry in %UserName%.txt.
It tells you straight away his host name.
 
As an afterthought: You can easily automate the process I mentioned
in my first reply, by creating a shortcut on your desktop that invokes
the following batch file:

Line1 @echo off
Line2 echo.
Line3 set /p name=Please enter the user's logon name:
Line4 if "%name%"=="" goto :eof
Line5 if not exist \\YourServer\SomeShare\%name%.txt echo Sorry, no record
for %name% && goto Exit
Line6 for /F "tokens=*" %%* in ('type \\YourServer\SomeShare\%name%.txt')
do set Last=%%*
Line7 echo Last logon event: %Last%
Line8
Line9 :Exit
Line10 echo.
Line11 pause
 
Back
Top