Ejemplo n.º 1
0
        static void Get_Hosts()
        {
            // GET ACTIVE DIRECTORY USERS
            GetActiveDirectory _objADinfo             = new GetActiveDirectory(domain_path, domain_name);
            List <user>        Users                  = _objADinfo.Get_Users();
            List <user>        NormalUsers            = Users.Where(x => x.isNormalAccount == true).ToList <user>();
            List <user>        NormalUsersNotDisabled = NormalUsers.Where(x => x.isAccountDisabled == false).ToList <user>();

            _objADinfo = null;

            // SAVE DATA TO LITEDB DATABASE
            context _userContext = new context(database_path + "user.db");

            _userContext.Upsert <user>(NormalUsersNotDisabled);


            //test export to Json
            _userContext.ExportToJson <user>(Users);
        }