Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I need to get a list of users that have logged onto a computer, i'm currently doing this at the moment by going into the Documents and Settings folder and copying and pasting the name of each folder(the persons username) into an Excel spreadsheet. Is it possible to export all of them into an Excel spreadsheet say for example? If not, is there an easier way to do this?

share|improve this question
    
This method only tells you a username within a domain, not the full username. E.g. AcmeInc\Joe would have just C:\Documents and Settings\Joe. –  MSalters Jul 31 '12 at 11:50
    
Yeah .. :) I'm only working within one domain so it matches :) Thanks –  Kevin Dodd Jul 31 '12 at 15:12

1 Answer 1

up vote 1 down vote accepted

Will following command satisfy your needs?

dir /AD /B "C:\Documents and Settings" >> user.log

You can also type in the RUN: compmgmt.msc

The computer management console will appear. Right click on Users hive and select export. It will give you list of all users.

share|improve this answer
    
It would be great, the only problem is, is that I'm "UNC'ing" to a remote computer on the network, i have no idea how i would use that command for a remote pc! I've looked everywhere and can't find anything. –  Kevin Dodd Jul 31 '12 at 9:35
1  
UNC - you mean you use a share path like \\pc\c$\Documents and Settings\ ? Just place it in the command prompt instead of the path i provided. If you have a share mapped to specific drive letter - just place this letter instead of C drive in the example above. –  mnmnc Jul 31 '12 at 9:38
3  
it's in the directory you have in the command prompt as default. if you have C:\Documents and Settings\yourusername\ this is the place to search for the file. Or it might be on your desktop. You can specify the location directly by using >> C:\user.log - it will be on your C drive. –  mnmnc Jul 31 '12 at 9:43
    
Excellent! Works wonders! Thank you very much. –  Kevin Dodd Jul 31 '12 at 9:44
1  
Note that this only works in English (and English-derived) versions of XP. C:\Dokumente und Einstellungen is the German equivalent. Locally, you can query the %ALLUSERSPROFILE% variable. –  MSalters Jul 31 '12 at 11:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.