Advertisement
|
[x]
Posted via EE Mobile
|
||
Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
||
| 08/12/2008 at 12:34PM PDT, ID: 23642474 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
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: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: |
'===============================================================================
'===============================================================================
Dim objFSO 'File System Object
Dim objShell 'Windows Shell
Dim strDomain 'Domain to Enumerate (LDAP Path)
'-->Set the LDAP Path to the Domain
strDomain = "LDAP://FakeDomainName"
'-->Initialize basic variables
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("wscript.shell")
'-->Enumerate Domain Groups
GetBaseContainers
'-->Completion notification
MsgBox "Finito",,"Script Completion Notice"
'===============================================================================
'Sub GetBaseContainers
'===============================================================================
Sub GetBaseContainers
On Error Resume Next
Dim objDomain 'Domain Object instantiated
Dim objOU 'Organizational Unit or container instantiated
'-->Bind to the Domain
Set objDomain = GetObject(strDomain)
'-->DomainDNS object contains no groups, set the filter to OUs
objDomain.Filter = Array("organizationalUnit")
'-->Cycle through each OU and enumerate groups
For Each objOU In objDomain
EnumLDAPOU objOU.ADSPath,"FakeDomainName/" & Right(objOU.Name,Len(objOU.Name)-3)
Next
'-->DomainDNS object contains no groups, set the filter to Containers
objDomain.Filter = Array("container")
'-->Cycle through each container and enumerate groups
For Each objOU In objDomain
EnumLDAPOU objOU.ADSPath,"FakeDomainName/" & Right(objOU.Name,Len(objOU.Name)-3)
Next
'-->DomainDNS object contains no groups, set the filter to builtinDomain
objDomain.Filter = Array("builtinDomain")
'-->Cycle through each builtinDomain object and enumerate groups
For Each objOU In objDomain
EnumLDAPOU objOU.ADSPath,"FakeDomainName/" & Right(objOU.Name,Len(objOU.Name)-3)
Next
End Sub
'===============================================================================
'Sub EnumLDAPOU
'===============================================================================
Sub EnumLDAPOU(LDAPPath,LDAPTrace)
On Error Resume Next
Dim objLDAPOU 'Organization unit object
Dim objGroup 'Group object
Dim strName 'The Name of the group
Dim strPath 'The LDAP ADSPath of the group
Dim intLDAPCount 'The number of members in the group
'-->Bind to an AD OU
Set objLDAPOU = GetObject(LDAPPath)
'-->Look at just the groups in the OU
objLDAPOU.Filter = Array("group")
'-->Go through each group and get it's attributes
For Each objGroup In objLDAPOU
'-->Initilaize attribute variables
strName = ""
strPath = ""
'-->Get the attribute variables
strName = LCase(objGroup.SamAccountName)
strPath = LCase(objGroup.ADSPath)
strPath = Replace(strPath,"ldap://","LDAP://")
'-->Get the membership count
intLDAPCount = 0
intLDAPCount = objGroup.Members.Count
'--------------->
'More Code is here to keep track of the counts
'--------------->
Next
objGroup = Null
'-->Enumerate any groups in this OU's Sub OUs
objLDAPOU.Filter = Array("organizationalUnit")
For Each objOU In objLDAPOU
EnumLDAPOU objOU.ADSPath,LDAPTrace & "/" & Right(objOU.Name,Len(objOU.Name)-3)
Next
'-->Enumerate any groups in this OU's Sub OUs
objLDAPOU.Filter = Array("container")
For Each objOU In objLDAPOU
EnumLDAPOU objOU.ADSPath,LDAPTrace & "/" & Right(objOU.Name,Len(objOU.Name)-3)
Next
End Sub
'===============================================================================
'===============================================================================
|