Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想为给定用户创建一个 WindowsIdentity。我不需要它来模拟,只是用于组成员资格检查。我需要它在有和没有域的情况下工作(没有 S4U Kerberos 委托的东西)。采用用户名的 WindowsIdentity 构造函数似乎仅适用于域方案。
有没有其他方法可以获得 WindowsIdentity 来执行访问检查?我最好的解决方法是使用 DirectoryServices.AccountManagement 来查找用户,然后枚举他们的组。