Re: enumerating Domain Users Group

From: Al Dunbar [MS-MVP] (alan-no-drub-spam_at_hotmail.com)
Date: 02/25/04

  • Next message: Al Dunbar [MS-MVP]: "Re: Script to get the local admin account"
    Date: Tue, 24 Feb 2004 20:51:10 -0700
    
    

    "Chris Jones" <anonymous@discussions.microsoft.com> wrote in message
    news:2CFEE60F-B150-4BAB-902C-878DE7079D5E@microsoft.com...
    > I am using the below script to enumerate each user in the Domain Local
    group of my domain.

    Is it the "domain users" group you are interested in (as suggested by the
    binding string) or something called "the Domain Local group"?

    > When trying to enumerate the group, I get no results back when doing a
    wscript.echo groupmember.cn. However, if I change my user group to
    something else, the script works like a champ.

    To clarify, you change the binding string to reference a different group,
    leaving the loop the same?...

    > Does anybody have any suggestions on this? Does anybody know of any
    reasons why I cannot enumerate the group?

    ... but below you seem to suggest that you can enumerate the group, just
    cannot seem to display the members' CN properties...

    >
    > If I look at the group with the Domain Users and Computers mmc, the group
    is populated as you would expect. Thanks in advance for any help! When I
    echo out the adspath, the ldap path is correct.

    And by this, you mean that you change the loop to echo groupmember.adspath
    instead of groupmember.cn? If that is the case, I am not sure what the
    problem is... Sorry.

    /Al

    >
    > Option Explicit
    > Dim oGroup, groupmember
    > Set oGroup = GetObject("LDAP://cn=domain
    users,cn=Users,dc=MyDomain,dc=root")
    > wscript.echo ogroup.adspath
    > For Each groupmember In ogroup.members
    > wscript.echo groupmember.cn
    > Next


  • Next message: Al Dunbar [MS-MVP]: "Re: Script to get the local admin account"

    Relevant Pages

    • Enumerate everything below and including Domain users?
      ... Domain users, one called a users and one called b users. ... What do I need to add to this script to get it two enumerate everything ... Dim OutPutFile ... 'Enumerate Container ...
      (microsoft.public.scripting.vbscript)
    • Re: users have gray hair in Domain Users group
      ... The members of domain users group in both of the tree domains have ... when I use the below script to enumerate the membership of the ... domain users group in each of the domains, ... any reasons why I cannot enumerate the Domain Local group? ...
      (microsoft.public.win2000.active_directory)
    • Re: users have gray hair in Domain Users group
      ... The members of domain users group in both of the tree domains have ... when I use the below script to enumerate the membership of the ... domain users group in each of the domains, ... any reasons why I cannot enumerate the Domain Local group? ...
      (microsoft.public.win2000.active_directory)
    • Re: Error using LDAP query
      ... If your clients are XP, they have the ADSystemInfo object, so don't worry ... Most likely all of your users have "Domain Users" as their ... member of at least 2 other groups, ... Your script runs without error for me when I am logged into a ...
      (microsoft.public.windows.server.scripting)
    • Re: export users from a local group with domain membership
      ... >> The idea is I'm in the process of rebuilding a server, ... So I want a script where I could do a quick ... one that export only domain users to a text ... > Const OverwriteIfExist = -1 ...
      (microsoft.public.scripting.vbscript)

    Loading