header image

Disable Global catalog

Posted by: | March 18, 2012 | No Comment |

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)            

Similar to enabling but this time we create a GlobalCatalog object and use the DisableGlobalCatalog() method

under: PowerShell and Active Directory