?
Solved

Exporting usrmgr fields

Posted on 2003-02-25
5
Medium Priority
?
647 Views
Last Modified: 2007-12-19
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
Comment
Question by:jacks3335
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 

Accepted Solution

by:
omalakai earned 400 total points
ID: 8022468
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
 
LVL 1

Expert Comment

by:CosmoNut
ID: 8022812
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
 

Expert Comment

by:stevebates1
ID: 8024617
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
 

Expert Comment

by:PaulRG
ID: 8039484
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
 
LVL 2

Expert Comment

by:Renots
ID: 9417164
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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction How to create multiboot configuration with XP\Vista and Windows 7 on it? And most important question - how to do this correctly so not to have any kind of nightmares we get when system gets screwed? First of all one should realize t…
As the title indicates, I have done this before. It chills me everytime I update the OS on my phone, (http://www.experts-exchange.com/articles/18084/Upgrading-to-Android-5-0-Lollipop.html) because one time I did this and I essentially had a bricked …
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question