![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | 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 Specs![]() |
![]() |
| 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 | |||