AD主要组计数错误

时间:2013-04-02 15:32:56

标签: c# active-directory

我正在使用C#为用户提取活动目录组。由于某种原因,该应用程序在以下代码段中为一个用户抛出了错误

PrincipalSearchResult<Principal> groups = user.GetGroups();
int total = groups.Count();

错误:

  

指数超出范围。必须是非负数且小于集合的大小。
  参数名称:index

我以前从未见过Count()方法抛出此类错误。

0 个答案:

没有答案