16.8. 在 Windows 同步中配置多个子树和过滤器
Windows 同步设计为在 Directory Server (DS)和 Active Directory (AD)上的多个子树对之间同步。通过使用过滤器,只有子树下的指定条目才会同步。
Windows 同步中的多个子树
要在多个子树对间同步,请在 Windows 同步协议中的
winSyncSubtreePair
参数中配置 Directory 服务器和 Active Directory 子树。例如,设置多个 ou=OU1,dc=DSexample,dc=com 和 ou=OU1,DC=ADexample,DC=com 子树:
dsconf -D "cn=Directory Manager" ldap://server.example.com repl-winsync-agmt set --subtree-pair="ou=OU1,dc=DSexample,dc=com:ou=OU1,DC=ADexample,DC=com" --suffix="dc=example,dc=com" example-agreement
# dsconf -D "cn=Directory Manager" ldap://server.example.com repl-winsync-agmt set --subtree-pair="ou=OU1,dc=DSexample,dc=com:ou=OU1,DC=ADexample,DC=com" --suffix="dc=example,dc=com" example-agreement
如果没有设置
winSyncSubtreePair
,则 nsds7WindowsReplicaSubtree
AD subtree 参数和 nsds7DirectoryReplicaSubtree
DS 子树参数会被用于同步目标检查。否则,这两个参数将被忽略。
Windows 同步中的过滤器
您可以设置一个过滤器,在以下参数中选择要同步的数据:
--win-filter
在 Active Directory 服务器上设置额外的过滤器,--ds-filter
参数在 Directory Server 上设置额外的过滤器。
以下示例配置,
example_agreement
同步条目,它包含 user
和 group
属性:
dsconf -D "cn=Directory Manager" ldap://server.example.com repl-winsync-agmt \ set --win-filter="(|(cn=*user*)(cn=*group*))" --ds-filter="(|(uid=*user*)(cn=*group*))" \ example_agreement
# dsconf -D "cn=Directory Manager" ldap://server.example.com repl-winsync-agmt \
set --win-filter="(|(cn=*user*)(cn=*group*))" --ds-filter="(|(uid=*user*)(cn=*group*))" \
example_agreement