Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want a script that will show all local users of a windows server (2003/2008) with all details like loginname, fullname, group etc etc. like "net user" gives all logins and then I need to do "net user login" to get info about a login. I want all informations in a single command / script. Please help

share|improve this question
This sounds an awful lot like plz email me teh codez, which is kind of frowned upon. Also "etc, etc" isn't really a good way to enumerate your requirements. There are a lot of possible attributes that can be returned for a user. Please list all of the ones that you are interested in. – MDMarra Mar 9 '12 at 1:33

Here's a one-liner in Powershell:

([ADSI]"WinNT://localhost,computer" ).psbase.Children | ?{ $_.psbase.schemaclassname -eq 'user' } | Format-List *
share|improve this answer
This is two times in two days that you've beat me to a PS answer :) – MDMarra Mar 9 '12 at 1:38
To be fair, I googled it and streamlined the best scripts that I found – Mark Henderson Mar 9 '12 at 1:42

Your Answer


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.