Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tracing computer name user is logged onto

Status
Not open for further replies.

CC801340

IS-IT--Management
Jul 10, 2001
147
GB
I need a way of returning the computer name of the computer on which user x is logged on to. Is this possible?!

At the moment I have a batch file containing the following commands but it isnt a complete solution:

nbtstat -r
net send %1 .
nbtstat -c

Many thanks in advance!


 
Hi CC,

I know the other way around: nbtstat -a ipaddress give you who is logging on.

Btw what is net send %1

Thanks
 
Ive saved the batch file as muser.bat and when I run it i type "muser username" - the %1 is then replaced with username - eg muser rs1 would run the following commands:

nbtstat -r
net send rs1 .
nbtstat -c

I do not have the IP address either and so I need to return the computer name (and IP address as well would be great!) by just stating the username.



 
Can you do that?
It gives error message that I can't send a file except if I do: net send username message
 
You can only use %1 in a batch file...the following should help explain!

muser.bat contains the following:

nbtstat -r
net send %1 .
nbtstat -c

From a command prompt:

C:\>muser zhajc1

That then does all of this automatiaclly:

C:\>nbtstat -r

NetBIOS Names Resolution and Registration Statistics
----------------------------------------------------

Resolved By Broadcast = 0
Resolved By Name Server = 35

Registered By Broadcast = 0
Registered By Name Server = 7

C:\>net send zhajc1 .
The message was successfully sent to ZHAJC1.


C:\>nbtstat -c

Local Area Connection:
Node IpAddress: [10.208.3.148] Scope Id: []

No names in cache


Hope that makes sense!!

Its a too long winded though - I need a command like muser that would simlpy return the IP address or computer name without sending the user a net send


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top