Add Attributes to Global Catalog Replication

To add Attributes to Global Catalog Replication , supply the attribute name as parameter.

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()

 

Output

Replicatetogc1
Replicatetogc2

Leave a Reply