Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - Finding Nested ID in Groups

Reply
 
Old 08-21-2008   #1 (permalink)
patories


 
 

Finding Nested ID in Groups

I have a client that has decided to have 2 DC's for their company. One
for all internal employees and the other for Sharepoint and External
contractors.

What they are planning on doing is granting the internal employee
access to the Sharepoint AD groups directly instead of Trusting
Internal AD group to External AD group. They would like a script to
tell them what External AD groups an Internal Employee is tied to so
they can remove access if that employee leaves the company.

Since the Internal USERID does not exsist in the Sharepoint Domain I
am unable to search for them that way. I can pull their Membership
information from the Sharepoint site if I know the AD group they
belong to, but I can not do a search based on the userid.

I am currently using this script, works great in querying EVERY group
but I need it to Query only in the ROLES OU and then give me a list of
of what groups a user is nested in. I will also eventually like to
delete the users from the local groups once they are found.

Set DomainObj = GetObject("WinNT://myexternaldomain.com")
set objuser = GetObject("WinNT://myenternaldomain.com/" &
TRIM(Inputbox

("Please Enter the User Account Name", "UserID")) & ",User")

wscript.echo (objuser.adspath)
DomainObj.Filter = Array("Group")

For Each GroupObj In DomainObj
If GroupObj.Class = "Group" Then
List = ""

For Each UserObj in GroupObj.Members
If UserObj.Class = "User" Then
List = List & UserObj.Name & VbCrLf
End If
Next
If Groupobj.IsMember(objUser.AdsPath)Then
wscript.echo "Account Found"
'objGroup.Delete(objUser.AdsPath)
End If


WScript.Echo GroupObj.Name & ": " & VbCrLf & VbCrLf & List

End If

Next

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Finding members of RDP groups of a list of computers VB Script
Re: Active Directory removing nested groups and subsequently members PowerShell
Nested Messages Live Mail
view nested groups problem PowerShell
Getting the users from nested groups using Quest snap-in PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46