• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 651
  • Last Modified:

Exporting usrmgr fields

I want to export/copy the fields in usrmgr to a text/csv file for upload into a database.  Under usrmgr there is no export and you can't highlight and right click.  How can I copy these entries into a file?
0
jacks3335
Asked:
jacks3335
1 Solution
 
omalakaiCommented:
Dameware NT Utilities has a built-in export of the SAM info. It pulls out the following fields:

DomainName, ServerType, ServerName, UserName, FullName, Comment, UserComment, HomeDir, HomeDirDrive, ScriptPath, Profile, LogonTo, LastLogon, LastLogoff, BadPwCount, NumLogons, PwExpires, PwExpired, NoExpirePwd, Disabled, LockedOut, NoPwRequired, UserCantChgPw, RAS, RASCallback, SetByCaller, CallbackNo, PwAgeInDays, PwLastChg

Basically everything but the password.

www.dameware.com

hope this helps
0
 
CosmoNutCommented:
As posted in your repeat, NT4 Resource kit, and 2k pro resource kit included a utility called "adduser.exe" for importing and exporting user accounts to/from a comma delim text file.
0
 
stevebates1Commented:
On a DC open a command prompt and run
net users >c:\userlist.txt
this creates a file of all the users in your organisation.
next edit the file using a text editor and get each user on a line, so that the command
net users username >>userprops.txt
is run for each user.
this will give you the following information for each user in the userprops.txt file:
User name  ,Full Name  ,Comment ,User's comment,Country code  ,Account active,Account expires  ,,Password last set,Password expires ,Password changeable ,Password required,User may change password  ,,Workstations allowed,Logon script  ,User profile  ,Home directory,Last logon ,,Logon hours allowed ,,Local Group Memberships,  ,Global Group memberships

You will find that notepad is probably not up to the task of quickly editing such a file, I used textpad, as you can do search and replace on regular expressions, if you needed to automate this a perl program could quickly be set up to automate this.
0
 
PaulRGCommented:
Just a freebie solution....
You can use the Windows script below to list the users for your domain and write their properties to a csv text file. As not all properties are supported by NT4.0, leave the on error clause, so the script does not crash when certain properties are not found. (I assume you have the latest Microsoft DCOMs and ADSI installed to get to the objects used)
Just save the code below as userinfo.vbs and run it from the command prompt  
as: cscript userinfo.vbs
'
' userinfo.vbs - list user account details for your domain
'
on error resume next
'create output csv file
Set Myfso = CreateObject("Scripting.FileSystemObject")
Set MyFile = Myfso.CreateTextFile("c:\userinfo.csv", True)
'obtain your domain name
Set Wnet = wscript.CreateObject("WScript.Network")
wscript.Echo "Userinfo for Domain:" & Wnet.UserDomain
' loop thru all users
set ogrp = GetObject("WinNT://"&WNet.UserDomain&"/Users")
set ombr = ogrp.members()
' get all properties for a user (delete the ones you dont need)
for each ousr in ombr
 with ousr
 wscript.echo("user="&ousr.name)
     line=""
     line=line&""""&.name&""","
     line=line&""""&.AccountExpirationDate&""","
     line=line&""""&.AutoUnlockInterval&""","
     line=line&""""&.BadPasswordAttempts&""","
     line=line&""""&.Description&""","
     line=line&""""&.FullName&""","
     line=line&""""&.HomeDirDrive&""","
     line=line&""""&.HomeDirectory&""","
     line=line&""""&.UserFlags&""","
     line=line&""""&.LockoutObservationInterval&""","
     line=line&""""&.LoginHours&""","
     line=line&""""&.LastLogin&""","
     line=line&""""&.LastLogoff&""","
     line=line&""""&.LoginScript&""","
     line=line&""""&.LoginWorkstations&""","
     line=line&""""&.MinPasswordAge&""","
     line=line&""""&.MinPasswordLength&""","
     line=line&""""&.MaxBadPasswordsAllowed&""","
     line=line&""""&.MaxLogins&""","
     line=line&""""&.MaxPasswordAge&""","
     line=line&""""&.MaxStorage&""","
     line=line&""""&.ObjectSid&""","
     line=line&""""&.Parameters&""","
     line=line&""""&.PasswordAge&""","
     line=line&""""&.PasswordExpirationDate&""","
     line=line&""""&.PasswordExpired&""","
     line=line&""""&.PasswordHistoryLength&""","
     line=line&""""&.PrimaryGroupID&""","
     line=line&""""&.Profile
     MyFile.WriteLine(line)
  end with
next
  MyFile.Close

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0
 
RenotsCommented:
jacks3335,

No comment has been added lately (207 days), so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question
is:

to be PAQ'd, with points forfeited.

Please leave any comments here within the next SEVEN days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Renots
EE Cleanup Volunteer
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now