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
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.
-
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
-