Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

display hostname and user's name ?

Posted on 2003-10-28
6
Medium Priority
?
1,101 Views
Last Modified: 2008-02-26
is there any scripts or application that can list the current users name with their host name ? We have 200 windows PC that use C001,...C200, each time we have hardtime to find out who is running the PC, we need to either go to WINS, nbtstat, Manager .. to check name one by one.

This is a Win 2000 Active Directive Domain.

0
Comment
Question by:joehuang
  • 3
  • 3
6 Comments
 
LVL 2

Expert Comment

by:EschbacherG
ID: 9642464
Hey Joe,

We have a similar script we run at logon time.  It writes the username, hostname, ip address, and antivirus information to a file on our server.

Anyway, the parameters you want are:

%username%
%computername%

In a logon script, you could something like:

@echo   %username%,  %computername%    >>   \\server\share\login.txt
0
 

Author Comment

by:joehuang
ID: 9643697
Esch,

Is there any way to monitor what object the user access to in real time thru script ?
0
 
LVL 2

Accepted Solution

by:
EschbacherG earned 120 total points
ID: 9644063
You can try using the "PSLoggedOn" tool from www.sysinternals.com.   It's part of the PSTools package for WindowsNT/2000

The format of the command would be:

psloggedon \\C001

You could write a batch file to get the list of users by doing the following:



net view >> host_list.txt

for /f "tokens=1" %%a  in (host_list.txt) do (

  psloggedon \\%%a   >>     user_log.txt

)
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 

Author Comment

by:joehuang
ID: 9645025
Esch,

It seems that your are very familiar with scripting. Is there any good book or web site I can study from ?

Thanks,
0
 
LVL 2

Expert Comment

by:EschbacherG
ID: 9657605
Honestly Joe, Experts-exchange is a great site for various scripts.  If you're not premium member, I would use google to search only EE.

Besides that, i've relied on the Help built into Windows, for help with commands like   for-do loops and what not.

If you've got any more questions, i'd be glad to help you out :)
0
 

Author Comment

by:joehuang
ID: 9717557
Esch,

Would you explain the syntax of "tokens=1" %%a ? I check the windows helper, It seems that tokens=1 parse  the first word from the batch file, how about a in "%%a" ?

please advice.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
Aerodynamic noise is the cause of the majority of the noise produced by helicopters. The inordinate amount of noise helicopters produce is a major problem in the both a military and civilian setting. To remedy this problem the use of an aerogel coat…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

877 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question