创建 Active Directory 组后使用 DirectorySecurity 设置 NTFS 权限

发布于 2024-09-03 20:59:12 字数 281 浏览 5 评论 0原文

在创建 Active Directory 组(均以编程方式)后,我对为目录设置 NTFS 权限感到有点困惑。当我创建 Active Directory 对象时,我必须等待几秒钟才能设置 NTFS 权限。如果我没有这个超时,那么我有时会收到一条错误消息,指出找不到标识(活动目录组名)。 DirectoryInfo-Class 中的 DirectorySecurity-Class 是否可能具有不同的算法来从活动目录对象获取身份?因为当我使用 System.DirectoryServices 检查活动目录中的组是否存在时,所有对象在创建后突然存在。

I am a little confused about setting NTFS Permissions to a directory after I created Active Directory Groups (both programmatically). When I created the Active Directory Objects then I have to wait a few seconds to set the NTFS Permissions. If I have not this timeout then I get sometimes an error message that the identify (active directory groupname) could not found. Is it possible that the DirectorySecurity-Class from DirectoryInfo-Class has an different algorithm to get the idenfity from active directory objects? Because when I checking the existing of the groups in active directory with System.DirectoryServices all the objects exist suddenly after creation.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

何以笙箫默 2024-09-10 20:59:12

我必须使用 AD 对象中的 SID 并使用 SecurityIdentifier-Class 作为身份。因此,当我现在使用 SecurityIdenfitier 设置权限时,不会有来自 NTAccount 的翻译,并且一切正常!

I have to use the SID from the AD Objects and use the SecurityIdentifier-Class for the identity. So when I set the permission now with a SecurityIdenfitier there won't be a translate from NTAccount and all works fine!

原来是傀儡 2024-09-10 20:59:12

您还可以通过使用用于创建安全主体的相同 DirectoryEntry 引用来分配权限来解决此问题。

You may also be able to solve this by assign the permissions using the same DirectoryEntry reference that you used to create the security principal.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文