Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Enumerating User accounts in NT 4.0 Domain

Status
Not open for further replies.

fkane17

Technical User
Jul 9, 2003
5
US
I am working for a company that still uses windows NT 4.0 servers and workstations. The PDC is still windows NT 4.0

I searched technet and found a script that enumerates user accounts in NT 4.0 domain:

Set objDomain = GetObject("WinNT://zigchor,domain")
objDomain.Filter = Array("User")
For Each objUser In objDomain
Wscript.Echo objUser.Name
Next

I modified it to make it work. It listed all the user in domain zigchor

I would like the script to read an excell spreadsheep and enumerate all the user id corresponding to the list of name provided in the spreadsheet.

for exemple the excell spreadsheep contains:

Last Name First Name UserID

Sarr Mamadou
Sene Pierre
Coly Atika

 
you are going to get some big loops in this i fear
i suppose you could mess around with excels find functions?

One things for sure you are going to have to assume some things, naming that the combination of LastName/FirstName in your

Last Name First Name UserID

Sarr Mamadou
Sene Pierre
Coly Atika



is unique, otherwise how do you know which one you are talking about?
More importantly you have know that your FullName property in yor domain has been correctly filled out when the accounts were setup, and you need to know that they were filled out in a specific way. i.e. %Firstname% %Lastname%, if that was your naming standard.

Thinkin about it that is what you havent told us.
What is the non-intuitive link between your Lastname/Firstname in your excel spreadsheet and the Domain account names???

Can we assume anything?

either the objUser.FullName must be directly linked to the excel spreadsheet or the objUser.Name must be, eg you might have had your naming convention for usernames = First letter of FirstName + First 4 letters of Surname.

before we go on you must tell us

richard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top