无法检索有关域的信息(1355) [英] Information about the domain could not be retrieved (1355)
问题描述
这是我的代码示例
var domainContext = new PrincipalContext(ContextType.Domain, "domain_server_ip",
"domain_admin_username", "domain_admin_password");
var group = GroupPrincipal.FindByIdentity(domainContext, "mygroup");
var users = group.Members.Where(member => names.Contains(member.Name))
.ToList();
users.ForEach(u => group.Members.Remove(u));
group.Save(domainContext); // <-- Here I get the error
如果我尝试获取用户组,则会出现相同的错误
Same error if I try to get user groups
var user = UserPrincipal.FindByIdentity(domainContext, "username");
var gps = user.GetGroups(domainContext).ToList(); // <-- Here I get the error
我尝试在连接中使用 ContextOptions.SimpleBind
,但没有任何变化.
我也尝试过设置连接中的容器名称,但同样没有任何变化.
I tried using ContextOptions.SimpleBind
in connection, but nothing changes.
I've also tried setting a container name in connection, but again nothing changes.
请注意,我能够检索该论坛及其成员...,所以我不明白为什么我无法保存该论坛或读取用户论坛.
Please note that I'm able to retrieve the group and its members... so I don't understand why I can't save the group or read user groups.
推荐答案
尝试将要查询的域控制器的IP地址(在第一行-domain_server_ip中)添加为网卡IP设置中的第一台DNS服务器.(从
Try adding the IP address of the domain controller you're querying (in the first line - domain_server_ip) as the first DNS server on your network card's IP settings. (borrowed from here)
这篇关于无法检索有关域的信息(1355)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!