Dim DomainContainer As IADsContainer
Dim NewGroup As IADsGroup
'Bind to the known container.
'Here DomainName is your domain name.
Set DomainContainer = GetObject("NTDS://DomainName ")
'Set the filter to enumerate Groups
DomainContainer.Filter = "Group"
'Enumerate all Groups in the Domain
For Each NewGroup In DomainContainer
Debug.Print NewGroup.Name
Next NewGroup