Add Attributes to Global Catalog Replication
It is common for IT admins to notice that few AD attributes are not natively in the global catalog replication set. Adding these attributes to the Global Catalog replication set is necessary so that all the DC's in the network carry the updated copies of all the attributes.
To add attributes to the Global Catalog Replication set, supply the attribute name as parameter and execute the following PowerShell script.
Script
<# .SYNOPSIS This script can be used to add Attributes to Global Catalog Replication . .DESCRIPTION This script can be used to add Attributes to Global Catalog Replication . .EXAMPLE C:\PS> C:\Script\Replicate_To_GC.ps1 badPwdCount
To replicate badPwdCount to GlobalCatalogue.
#>
param([String] $attribute )
$strAttrName = $attribute
$boolAddToGC = $true
$root = [ADSI] “LDAP://RootDSE”
$objAttr = [ADSI](“LDAP://cn=” + $strAttrName + “,” + $root.schemaNamingContext)
#You can add to the attributes that are stored in the global catalog by setting the isMemberOfPartialAttributeSet attribute of an attributeSchema object to TRUE.
$objAttr.Put(“isMemberOfPartialAttributeSet”, $boolAddToGC)
$objAttr.setInfo()
Related Articles
List Attributes of any Active Directory object
Most PowerShell scripts available in the internet can help administrators retrieve certain common attributes of an user, group, or a computer. Most scripts either document only specified attributes, or at best only the attributes that have been ...
How to add/remove Active Directory users to Active Directory groups using PowerShell
Active Directory is a powerful tool for managing users and groups in a Windows environment. One of the most often-repeated tasks for administrators is to add or remove users from Active Directory groups. In this article, we will explore how to ...
Performing bulk operations in Microsoft 365 with PowerShell
Performing bulk operations in Microsoft 365 with PowerShell, such as bulk adding users or modifying attributes, can be a very useful and efficient way to manage your organization's users and resources. PowerShell is a powerful command-line tool that ...
How to create, copy and remove Active Directory users using PowerShell
One of the most fundamental and often repeated task by an administrator is to create, copy or remove an Active directory user. Thanks to the New-ADUser cmdlet, it is extremely simple. Below are the PowerShell scripts to create, copy and remove an ...
How to create and manage Microsoft 365 groups with PowerShell
Introduction: Microsoft 365 Groups is a collaboration feature that allows users to work together and share resources such as calendars, files, and email messages. Microsoft 365 Groups can be created and managed using the Microsoft 365 admin center, ...