以下代码返回给定Groupname的UserPricipal。但是在删除一个组之后,这个代码仍然返回一个UserPrincipal(删除的)。有没有办法删除这个“缓存”?如何清除UserPrincipal缓存
UserPrincipalLookupService upls=fs.getUserPrincipalLookupService();
UserPrincipal who;
try {
who = upls.lookupPrincipalByName("myDeletedGroupName");
} catch (IOException e1) {
// TODO Auto-generated catch block
return;
}
因为当设置Windows ACL的时候我需要UserPrincipalName。在重新创建一个具有相同名称的已删除组后,ACL被设置为旧组而不是新的 - 并且在Windows-GUI中查看时,我在ACL列表中看到旧的objectSid而不是新的组(-name)。
步骤简称:
1. creating AD Group "xxxx"
2. setting ACL in File f for xxxx
3. deleting Group "xxxx"
4. deleting ACL
5. create new Group "xxxx" in AD
6. setting ACL in File f for xxxx
-> the OldSid from the deleted Group is the ACL Principal
无法在UserPrincipalLookupService中指定服务器。我认为**%logonserver%**环境变量显示当前连接的域控制器。但我想设置许多ACL的远程,所以远程和我的电脑探测不到相同的DC。 –
+1有帮助;同样的问题在这里,我已经为此搜索了MSDN。当你说“复制通常很快发生”......有人知道生存时间的来源,或者可以在Windows 2012 PDC上配置这种缓存/复制策略吗? – dlatikay