예제 #1
0
        public ActionResult SyncRtx(string comName)
        {
            string    filePath = Server.MapPath("~/ADConfig.xml");
            AdOperate ado      = new AdOperate(filePath);
            //ado.GetADConfig(filePath,comName);
            DirectoryEntry entry  = ado.GetEntry();
            RtxDeptManager dept   = new RtxDeptManager();
            RtxUserManager user   = new RtxUserManager();
            string         filter = "objectclass=organizationalUnit";

            ado.OUEntrySyncRtx(entry, filter, dept);
            filter = "(&(objectCategory=person)(objectClass=user))";
            ado.UserEntrySyncRtx(entry, filter, user, dept);
            return(Json(new AjaxResult {
                Status = "ok", Msg = "success"
            }));
        }
예제 #2
0
        static void Main6(string[] args)
        {
            string         filePath = @" F:\1708\RtxLdap\TestCode\ADConfig.xml";
            AdOperate      ado      = new AdOperate(filePath);
            DirectoryEntry entry    = ado.GetEntry();
            RtxDeptManager dept     = new RtxDeptManager();
            RtxUserManager user     = new RtxUserManager();
            string         filter   = "objectclass=organizationalUnit";

            ado.OUEntrySyncRtx(entry, filter, dept);
            filter = "(&(objectCategory=person)(objectClass=user))";
            ado.UserEntrySyncRtx(entry, filter, user, dept);
            //if(ado.CheckADUser(path,"leinuo","Asd654123"))
            //{
            //    Console.WriteLine("测试成功");
            //}
            Console.WriteLine("测试成功");
            Console.ReadKey();
        }