We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you a podcast all about Citrix Workspace, moving to the cloud, and analytics & intelligence. Episode 2 coming soon!Listen Now

x

List Group Membership with recursion

byronleonard
byronleonard asked
on
Medium Priority
358 Views
Last Modified: 2012-06-27
I just found out that a non-admin can access the C$, D$ etc. shares just by going to Start | Run and entering \\servername\C$, etc...it doesn't even give a challenge for username/password. I can't figure out what's up. I checked the AD user who was able to do this, and he is not a member of admins. The root of the drive does have "Special" rights for the Everyone group under security...

Is there a way for me to list all users that are in the local administrators group on a computer?  I need to recurse through all nested groups memberships.

Thanks,
Comment
Watch Question

CERTIFIED EXPERT
Top Expert 2006

Commented:
Hi byronleonard,

access enum from sysinternals may help you narrow down on permissions on folders
http://www.sysinternals.com/Utilities/AccessEnum.html

have you looked under the local administrators group in computer management?

Cheers!
CERTIFIED EXPERT
Top Expert 2006

Commented:
This script from the MS technet magazine will get a user's group membership through a nested scenario.

If you read the article you might be able to modify the script for listing the admins in recursion.  I'm not a great scripter so this is about as much help as I can bring.

http://www.microsoft.com/technet/technetmag/issues/2006/03/ScriptingGuy/default.aspx

On Error Resume Next

SetobjUser=GetObject("LDAP://CN=Ken Myer," & _
    "OU=Finance,DC=fabrikam,DC=com")
Set colGroups = objUser.Groups
For Each objGroup in colGroups
    Wscript.Echo objGroup.CN
    GetNested(objGroup)
Next
Function GetNested(objGroup)
    On Error Resume Next
    colMembers = objGroup.GetEx("memberOf")
    For Each strMember in colMembers
        strPath = "LDAP://" & strMember
        Set objNestedGroup = _
        GetObject(strPath)
        WScript.Echo objNestedGroup.CN
        GetNested(objNestedGroup)
    Next
End Function

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Thank you for the points!
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.