Skip to main content
Jorge Bernhardt Jorge Bernhardt
  1. Posts/

How To use Set-ADObject cmdlet to Enable a Global Catalog on a DC

·155 words·1 min· 100 views · 5 likes ·
Get-ADDomainController Microsoft Microsoft Windows nltest.exe

In this mini-post, I want to show you how to enable or disable a global catalog on a Domain Controller (DC) using Windows PowerShell.

To perform this task, use the Set-ADObject cmdlet with the following syntax:

Set-ADObject  `
    -Identity <ADObject> `
    -Replace <Hashtable>

The -Identify parameter specifies the Active Directory object to modify. In this case, the NTDSSettingsObjectDN of the domain controller.

To obtain this value, use the Get-ADDomainController cmdlet with the following syntax.

Get-ADDomainController `
    -Server <String>

In the -replace parameter you can use:

  • @{options=‘1’} = Enable
  • @{options=‘0} = Disable

Run the following PowerShell command as administrator.

Global Catalog

Then, you can verify it through the command line with the nltest command using the following syntax:

nltest /server:<servername> /dsgetdc:<domainname>

nltest

The GC record in the Flags means that your GC is ready.

Thanks for reading my post. I hope you find it useful.

If you want to know more about the Set-ADObject cmdlet, check out this link.