Ethical Hacking

Learn to find vulnerabilities before the bad guys do! Gain real world hands on hacking experience in our state of the art hacking lab. Course designed and taught by expert instructors with years of penetration testing experience. 12 student maximum in every class. Certification attempt included in every package.
Computer Forensics Training at InfoSec Institute

Gain the in-demand skills of a certified computer examiner, learn to recover trace data left behind by fraud, theft, and cybercrime perpetrators. Discover the source of computer crime and abuse at your organization so that it never happens again. All of our class sizes are guaranteed to be 12 students or less to facilitate one-on-one interaction with one of our expert instructors.




Network Security Focus-Microsoft
[Top] [All Lists]

RE: Automate group membership validation

Subject: RE: Automate group membership validation
Date: 13 Mar 2006 15:01:44 -0000
Hi,

I have finally wrote a small vbscript to do what I wanted to do :

'       Description : This script creates files containing the list of the 
members of the groups on an NT domain, using the full name of the users.

Dim groupsToAnalyze(1000,2)
Dim oFS
Dim strFile
Dim i
Const ForReading = 1
Const ForWriting = 2
Const ForAppending = 8

'       Column 1 : Name of the group
'       Column 2 : Name of the folder that corresponds to that group
'       Column 3 : Owner of the folder

groupsToAnalyze(0,0) = "Group1"
groupsToAnalyze(0,1) = "Folder1"
groupsToAnalyze(0,2) = "Owner1"

'       Delete all files in the output folder...
RootFolder = "T:\groups\!Sécurité répertoires"
Set oShell = CreateObject("WScript.Shell")
oShell.Run "%comspec% /c cd /d """ & RootFolder & """ && rd . /s /q", 0, True

'       Create output files (file names in the output will be "Owner - 
FolderName")
For Each group In groupsToAnalyze
        if isEmpty(group) Then Exit For
        Set oGroup = GetObject("WinNT://DOMAINNAME/" & group & ",group")
        For Each oUser In oGroup.Members
                Set oFS=CreateObject("Scripting.FileSystemObject")
                Set strFile = oFS.OpenTextFile(RootFolder & "\" & 
groupsToAnalyze(i,2) & " - " & groupsToAnalyze(i,1) & ".txt", ForAppending, 
True)
                strFile.WriteLine(oUser.FullName)
                strFile.Close
        Next
        i = i + 1
Next

Thanks to everyone that helped me,

Benoît Fortin

---------------------------------------------------------------------------
---------------------------------------------------------------------------

<Prev in Thread] Current Thread [Next in Thread>