Exemplo n.º 1
0
        static void CollectRemoteMachines()
        {
            /*
            var computer = new Computer();
            var username = ConfigurationManager.AppSettings["domain.admin.username"];
            var password = ConfigurationManager.AppSettings["domain.admin.password"];
            var domain = ConfigurationManager.AppSettings["domain.ldap.url"].Split(new string[] { "LDAP://" }, StringSplitOptions.None)[1]; //get only the domain.com part
            */
            var domainUrl = ConfigurationManager.AppSettings["domain.ldap.url"];
            var subUrl = ConfigurationManager.AppSettings["sub.domain.ldap.url"];
            var domain = new Util.LDAP(domainUrl);
            var sub = new Util.LDAP(subUrl);
            var domainWin32 = new Thread(new ParameterizedThreadStart(GoToAndCollectWin32));
            var subWin32 = new Thread(new ParameterizedThreadStart(GoToAndCollectWin32));

            ArrayList domainComputers = domain.SearchByFilter(computerFilter);
            ArrayList subComputers = sub.SearchByFilter(computerFilter);
            domainWin32.Start(domainComputers);
            subWin32.Start(subComputers);
        }
Exemplo n.º 2
0
        static void CollectRemoteMachines()
        {
            /*
             * var computer = new Computer();
             * var username = ConfigurationManager.AppSettings["domain.admin.username"];
             * var password = ConfigurationManager.AppSettings["domain.admin.password"];
             * var domain = ConfigurationManager.AppSettings["domain.ldap.url"].Split(new string[] { "LDAP://" }, StringSplitOptions.None)[1]; //get only the domain.com part
             */
            var domainUrl   = ConfigurationManager.AppSettings["domain.ldap.url"];
            var subUrl      = ConfigurationManager.AppSettings["sub.domain.ldap.url"];
            var domain      = new Util.LDAP(domainUrl);
            var sub         = new Util.LDAP(subUrl);
            var domainWin32 = new Thread(new ParameterizedThreadStart(GoToAndCollectWin32));
            var subWin32    = new Thread(new ParameterizedThreadStart(GoToAndCollectWin32));

            ArrayList domainComputers = domain.SearchByFilter(computerFilter);
            ArrayList subComputers    = sub.SearchByFilter(computerFilter);

            domainWin32.Start(domainComputers);
            subWin32.Start(subComputers);
        }