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?

1 Answer 1

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.

6
  • 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. Jan 11, 2014 at 14:54
  • Yes that worked.. now how do I send that to t a text file? I've never used powershell.. :) Jan 11, 2014 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.) Jan 11, 2014 at 15:26
  • 1
    Perfect!!! You're the best Jan 11, 2014 at 16:16
  • Is there a similar command for exporting the groups? Jun 21, 2017 at 9:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .