如何从 AD DirectoryEntry 获取 DOMAINUSER?
- 作者: 陪她i
- 来源: 51数据库
- 2022-10-21
问题描述
如何从 Active Directory DirectoryEntry (SchemaClassName="user") 对象获取 Windows 用户和域?
How can I get the Windows user and domain from an Active Directory DirectoryEntry (SchemaClassName="user") object?
用户名在 sAMAccountName 属性中,但我可以在哪里查找域名?
The user name is in the sAMAccountName property but where can I look up the domain name?
(我不能假设一个固定的域名,因为用户来自不同的子域.)
(I can't assume a fixed domain name because the users are from various subdomains.)
推荐答案
我在 CN=Partitions,CN=Configuration 中找到了一个包含所有域的分区容器.
I found a partitions container in CN=Partitions,CN=Configuration that contains all domains.
当您将用户与分区匹配时,您可以从 nETBIOSName+""+sAMAccountName 属性中读取真实域名.
When you match the user to the partion you can read the real domain name from the nETBIOSName+""+sAMAccountName property.
- C#通过fleck实现wss协议的WebSocket多人Web实时聊天(附源码)
- 团队城市未满足要求:MSBuildTools12.0_x86_Path 存在
- 使用 MSBuild.exe 在发布模式下构建 C# 解决方案
- 当我发布 Web 应用程序时,AfterPublish 脚本不运行
- 构建时 T4 转换的产品仅在下一个构建中使用
- ASP.NET Core Application (.NET Framework) for Windows x64 only error in project.assets.json
- 新的 .csproj 格式 - 如何将整个目录指定为“链接文件"到子目录?
- 如何将条件编译符号(DefineConstants)传递给 msbuild
- MSBuild 支持 Visual Studio 2017 RTM 中的 T4 模板
- NuGet 包还原找不到包,没有源
