How do I query a domain local group ? Suppose you are in Domain A and are member of a domain local group in Domain B. The Domain A DC does not know about it, nor does the GC. Only the Domain B DC knows about it. I finally came up with this solution. It is slow though as it has to query the AD tree..
' NAME: DomainLocalGroup.vbs
' AUTHOR: Woosie
' DATE : 02-03-2005
' COMMENT: Scan AD Tree looking for local group membership and then output
' list to screen.
struser = InputBox("User to assess local group membership (e.g. cn=bennnett_s) ?","Local Group Scanner")
' change next line to point to your root AD path.
Set oDomain = GetObject("[link]")
WScript.Echo("Searching Domain a.. Please wait..")
WScript.Echo (struser & " is a member of : ")
For myloop=0 To localgroup
For Each oObj In oContainer
For Each sClass in oObj.ObjectClass
If LCase(sClass) = "organizationalunit" Then
WScript.echo "Searching " & oObj.AdsPath
If LCase(sclass) = "group" Then
WScript.Echo oobj.name & " " & oObj.AdsPAth
set objGroup = GetObject(strPath)
for each objMember In objGroup.Members
if lcase(splitme(0))=lcase(struser) Then
ReDim Preserve localgroups(localgroup)
Wscript.Echo struser & " is a member of local group : " & strpath