Link to home
Start Free TrialLog in
Avatar of intentalo69
intentalo69

asked on

Script to get a list of SIDs in a NT 4.0 domain

Hello, I would like to get a complete list of all users, groups (local and globals ) and computers in a domain NT 4.0
Do you know any script to do it ?

Regards
Avatar of Pete Long
Pete Long
Flag of United Kingdom of Great Britain and Northern Ireland image

Copy all AD users to a text file

From https://www.experts-exchange.com/questions/20698009/Exports-Group-list-to-a-text-file.html#9073544

Being a scripting nut, I tend to approach these kind of problems from a scripting standpoint.

copy and paste the code below into "Mattisastud.vbs" and then run it.

Then open the GroupMembership.txt file and it should have everything you need.  
If you want to view the machine accounts also, uncomment the commmented line...

-=-=-=-=-=-=-=-=-=-=-=-=-=-  Code Below  -=-=-=-=-=-=-=-=-=-=-=-=-=-  

Dim myNetwork
Set myNetwork = CreateObject("Wscript.Network")

strDomain = myNetwork.UserDomain

Set objDomain = getobject("WinNT://" & strDomain) 'Grab the domain object
objDomain.filter = Array("Group") 'Filter for just computers.

Dim myFSO
Set myFSO = CreateObject("Scripting.FileSystemObject")
Set myFile = myFSO.CreateTextFile("GroupMembership.txt",1)

myOutput = ""

For each objGroup in objDomain
    myOutput = myOutput & objGroup.Name & vbcrlf
   For Each objUser in objGroup.Members
'          myOutput = myOutput & vbtab & objUser.Name & vbcrlf
         If right(objUser.name,1) <> "$" Then
              myOutput = myOutput & vbtab & objUser.Name & vbcrlf
         End if
   Next
Next

WScript.Echo myOutput
myfile.writeline myOutput

-=-=-=-=-=-=-=-=-=-=-=-=-=-  End Code  -=-=-=-=-=-=-=-=-=-=-=-=-=-  

CREDIT To :MAT

*****Other Links*****

How can I create a file containing all the user names in my domain?
http://www.jsiinc.com/subl/tip5500/rh5531.htm

How can I produce a list of the user logon names in my domain?
http://www.jsiinc.com/subi/tip4400/rh4490.htm

Run a Group/User or User/Group report.
http://www.jsiinc.com/SUBB/tip0700/rh0748.htm
here is another option
the csvde and ldifde utilities can export user information

http://www.microsoft.com/windows2000/techinfo/planning/activedirectory/bulksteps.asp
Avatar of intentalo69
intentalo69

ASKER

Hello guys!
thanks for the answer. I've tried to run this script in the NT 4.0 PDC, but this script does not work
I get the error "runtime error:file name or class name not found during...... operation: 'getobject'
I think this script cannot work in NT 4.0, doesn't it?
Please remember, that I would like to obtain a list of users and groups of a NT 4.0 domain.
Regards,
Richard
Ok my question is focus on the idea of getting a list of users (in plain text file) to be used as input
to other script that we have to get the SIDs.
I think it easy to create a list using Hyena or dameware and then use it as parameter list to the other script
Anyway I don`t know if there are any tool to generate a list of sid of all users and groups in a NT 4.0 domain (not in Actie directory)

ASKER CERTIFIED SOLUTION
Avatar of LittleRed1
LittleRed1

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial