Find knowledge base article(s) by searching for keywords in the title e.g. type linux in the search box below
Find knowledge base article(s) by browsing the subject categories of articles
Technology quick references, cheatsheets, user manuals etc.
Shop Online through ShopifyLite
Tutorials on various IT applications.
Search Title    (UL:0 |SS:f)

Software >> OS >> Windows >> API >> ADSI >> ADO >> How to list groups in another domain in the forest

Assumptions =========== - you are logged on to domain STAFF at a computer that is member of STAFF - you are listing the other domain STUDENT which together with STAFF belong to the forest MAIN.SOMECOLLEGE.EDU ( STAFF.MAIN.SOMECOLLEGE.EDU, STUDENT.MAIN.SOMECOLLEGE.EDU, MAIN.SOMECOLLEGE.EDU ) VBscript list.vbs ================= yourDomain = "GC://main.somecollege.edu/DC=student,DC=main,DC=somecollege,DC=edu" Const ADS_SCOPE_SUBTREE = 2 Set objConnection = CreateObject("ADODB.Connection") Set objCommand = CreateObject("ADODB.Command") objConnection.Provider = "ADsDSOObject" objConnection.Open "Active Directory Provider" Set objCommand.ActiveConnection = objConnection objCommand.CommandText = "select cn from '" & yourDomain & "' where objectClass='group'" objCommand.Properties("Page Size") = 500 objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE Set objRecordSet = objCommand.Execute objRecordSet.MoveFirst Do Until objRecordSet.EOF wscript.echo objRecordSet.Fields("cn").Value objRecordSet.MoveNext Loop
[ © 2008-2021 myfaqbase.com - A property of WPDC Consulting ]