Solved

display hostname and user's name ?

Posted on 2003-10-28
6
1,094 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 30 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
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 

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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Suggested Solutions

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…
Data breaches are on the rise, and companies are preparing by boosting their cybersecurity budgets. According to the Cybersecurity Market Report (http://www.cybersecurityventures.com/cybersecurity-market-report), worldwide spending on cybersecurity …
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

773 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