Of course once you’ve learned how to enable something you need to know how to disable
$dc = "dc02.manticore.org" $contextType = [System.DirectoryServices.ActiveDirectory.DirectoryContextType]::DirectoryServer $context = New-Object -TypeName System.DirectoryServices.ActiveDirectory.DirectoryContext -ArgumentList $contextType, $dc $gc = [System.DirectoryServices.ActiveDirectory.GlobalCatalog]::GetGlobalCatalog($context) $gc.DisableGlobalCatalog()
Similar to enabling but this time we create a GlobalCatalog object and use the DisableGlobalCatalog() method