1

I'm using Server 2008 R2 on a single server, AD not installed. When I go into Server Manager and right click the "Users" folder under Local Users and Groups, I'm given the option to "Export List", which creates a nice text file of my users. I've used the command line net user, but that only shows the username. Is the export option available from the command line?

2

Try:

get-wmiobject -class win32_useraccount | Select-Object Caption, FullName, Name, Description

in PowerShell and see if that gives you what you want. You can then export to text:

get-wmiobject -class win32_useraccount | Select-Object Caption, FullName, Name, Description | out-file c:\users\you\documents\accounts.txt

or csv:

get-wmiobject -class win32_useraccount | Select-Object Caption, FullName, Name, Description | export-csv c:\users\you\documents\accounts.csv

or whatever.

| improve this answer | |
  • the export feature exports name, full name and description, none of the net commands give this much info. I'm looking for a way to run the export feature from the command line. – Kevin Baker Jan 11 '14 at 14:54
  • Yes that worked.. now how do I send that to t a text file? I've never used powershell.. :) – Kevin Baker Jan 11 '14 at 15:21
  • Append "| out-file c:\users\you\documents\accounts.txt" or "| export-csv c:\users\you\documents\accounts.csv" to the end of the above command. (You can up-arrow to get your last command rather than retype that.) – Katherine Villyard Jan 11 '14 at 15:26
  • 1
    Perfect!!! You're the best – Kevin Baker Jan 11 '14 at 16:16
  • Is there a similar command for exporting the groups? – Gilles Lesire Jun 21 '17 at 9:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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