域用户

http://www.cnblogs.com/zhongweiv/archive/2013/01/05/ad_sync.html#tab_a

这边文章有详细描述

DirectoryEntry entry = null;

entry = new DirectoryEntry(string.Format("LDAP://{0}",domain),CrmUserName,CrmPassword,AuthenticationTypes.Secure);

DirectorySearcher mySearcher = new DirectorySearcher(entry);
                        //mySearcher.Filter= ("(&(|(cn=" + searchUser + ")))");
                    mySearcher.Filter = ("(&(objectClass=user)(sAMAccountName="+searchUser+"))");
                    SearchResult searchResult = mySearcher.FindOne();
                    if (searchResult != null)
                    {
                        isExist = true;
                        Log.i("获取当前用户是域用户");
                        //_firstname = searchResult.Properties["sn"][0].ToString();
                        //_lastname = searchResult.Properties["givenname"][0].ToString();
                    }

没有更多推荐了,返回首页

私密
私密原因:
请选择设置私密原因
  • 广告
  • 抄袭
  • 版权
  • 政治
  • 色情
  • 无意义
  • 其他
其他原因:
120
出错啦
系统繁忙,请稍后再试

关闭