NT 4.0 find all members in all groups? 
Author Message
 NT 4.0 find all members in all groups?

can someone please supply a script that will show me all the users of all
groups in a domain?

CaM



Fri, 18 May 2001 03:00:00 GMT  
 NT 4.0 find all members in all groups?
Try this, it will get a list of all the groups a user belongs to then call a
function for specific groups if the user belongs to that group...

adsPath = "WinNT://YourDomain/" & strUser
set dsObj = GetObject(adsPath)
For Each Prop In dsobj.groups
    Select Case Prop.Name
    Case "Domain Admins"
        'WshShell.popup "You are an Administrator"
        Call Administrators()
    Case "gzWellington"
        'WshShell.popup "You are a gz'er"
        Call gzStaff()
    End Select
    ' Add the group name to a string
    sMsg = sMsg & Prop.Name & sLF
Next 'Prop
' Display a message showing the groups the user belongs to
WshShell.Popup "You have been logged onto the domain" & sLf &_
  "with the following permissions:" & sLf &_
  sMsg, 5, "gzLogon Completed", 64

Regards,
Ian
WSH FAQ http://wsh.glazier.co.nz/frame.htm

Quote:

>THis is nice.

>What's the object or syntax to get a name of a particular group?

>I'd like to check if a user belongs to a certain group, if so do something.
>In this case I'd like to use SELECT CASE statement instead of IF..Then
using
>the IsMember statement.

>Thanks.

>Hang Hieng


>    No... but if you are imaginative and put two and two together you will
>get what you want. There is a code sample in the faq that enumerates domain
>objects. And a code sample in the faq that returns group membership. There
>you go.

>    Now for the spoon.... This is off the top of my head. You may need to
>trouble shoot it.

>    Set DomainObj = GetObject("WinNT://Your_Domain")
>    DomainObj.Filter = Array("groups")

>    For each Group in DomainObj
>    List = List & Group.Name & vbcrlf

>    Set GroupObj = GetObject("WinNT://your_domain/" & Group.Name)
>        For each Member in GroupObj.members
>            List = List & vbtab & Member.Name & vbcrlf
>        Next

>    Next
>    Msgbox List

>    Clarence
>    Check it out
>    http://cwashington.netreach.net

>    Win32 bit scripting. Everything you need to get up and running,
>    A script repository containing almost 100 sample scripts,
>    downloads, reference files, and technical support via an
>    online discussion forum.

>    (Pursuant to US Code, Title 47, Chapter 5, Subchapter II, 227, any and
>all
>    unsolicited commercial E-mail sent to this address is subject to a
>download
>    and archival fee in the amount of $1000 US.  E-mailing denotes
>acceptance of
>    these terms.)


>    what I really want is to display all groups with the users in each
group

>    i.e.

>    Programming (GROUP)
>    joe blogs (MEMBER)
>    will patton (MEMBER)

>    that type of thing, your site doesn't seem to have a script to do that?

>    thanks :-)

>    CaM

>        You can find this in the ADSI Faq on my site. Additionally there
are
>several scripts in the script repository that will be of use to you.

>        Clarence

>        Check it out
>        http://cwashington.netreach.net

>        Win32 bit scripting. Everything you need to get up and running,
>        A script repository containing almost 100 sample scripts,
>        downloads, reference files, and technical support via an
>        online discussion forum.

>        (Pursuant to US Code, Title 47, Chapter 5, Subchapter II, 227, any
>and all
>        unsolicited commercial E-mail sent to this address is subject to a
>download
>        and archival fee in the amount of $1000 US.  E-mailing denotes
>acceptance of
>        these terms.)


>        can someone please supply a script that will show me all the users
>of all
>        groups in a domain?

>        CaM



Mon, 21 May 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Find each group a user is a member of

2. Finding group member

3. Enumerate Local Group Members and Identify Domain of Members

4. Determing Groups in VB Script NT 4.0

5. Groups info in NT 4.0

6. NT 4.0 Groups

7. How can I read NT40 Global Groups in VB SCRIPT on NT 4.0

8. nt 4.0 global groups

9. create a local group (nt 4.0) ??

10. NT 4.0, user groups, PDC's, BDC's and IsMember

11. How do I add a domain global-groups in a member-server local group

12. WSH on NT 4.0 Server without IE 4.0 (5.0)

 

 
Powered by phpBB® Forum Software