Beispiel #1
0
 public bool IsLive()
 {
     GetDomain();
     if (!Domain.IsNullOrEmptyOrWhiteSpace())
     {
         ComputerObject _computer = new ComputerObject();
         return(_computer.IsConnectedToUrl(Domain));
     }
     return(false);
 }
Beispiel #2
0
 public void TestComputerObjectFindOne()
 {
     using (var computerObject = ComputerObject.FindOneByCN(this.ADOperator, this.ComputerCn))
     {
         Assert.AreEqual(this.ComputerOperatingSystemName, computerObject.OperatingSystemName);
         Assert.AreEqual(this.ComputerOperatingSystemVersion, computerObject.OperatingSystemVersion);
         Assert.AreEqual(this.ComputerOperatingSystemServicePack, computerObject.OperatingSystemServicePack);
         Assert.AreEqual(this.ComputerDnsName, computerObject.DnsName);
         Assert.AreEqual(this.ComputerSiteName, computerObject.SiteName);
     }
 }
Beispiel #3
0
        public void TestComputerObjectFindAllWithFilter()
        {
            var computerObjects = ComputerObject.FindAll(this.ADOperator, new Is(AttributeNames.CN, this.ComputerCn));

            foreach (ComputerObject computerObject in computerObjects)
            {
                using (computerObject)
                {
                    Assert.AreEqual(this.ComputerCn, computerObject.CN);
                }
            }
        }
Beispiel #4
0
        public void TestComputerObjectFindAll()
        {
            var computerObjects = ComputerObject.FindAll(this.ADOperator);

            Assert.AreNotEqual(0, computerObjects.Count);
            foreach (ComputerObject computerObject in computerObjects)
            {
                using (computerObject)
                {
                    Console.WriteLine(computerObject.Path);
                }
            }
        }
Beispiel #5
0
 public void TestComputerObjectManagedBy()
 {
     using (var computerObject = ComputerObject.FindOneByCN(this.ADOperator, this.UserManageComputerCn))
     {
         Assert.AreEqual(this.ComputerManagedByUserCn, computerObject.ManagedByObject.CN);
     }
     using (var computerObject = ComputerObject.FindOneByCN(this.ADOperator, this.GroupManageComputerCn))
     {
         Assert.AreEqual(this.ComputerManagedByGroupCn, computerObject.ManagedByObject.CN);
     }
     using (var computerObject = ComputerObject.FindOneByCN(this.ADOperator, this.ContactManageComputerCn))
     {
         Assert.AreEqual(this.ComputerManagedByContactCn, computerObject.ManagedByObject.CN);
     }
 }
Beispiel #6
0
        async public Task InitComboBox()
        {
            cmbCatalog.Items.Clear();

            ComputerObject computer = new ComputerObject(null);

            cmbCatalog.Items.Add(new ExplorerObjectComboItem(computer.Name, 0, 0, computer));

            foreach (IExplorerObject exObject in await computer.ChildObjects())
            {
                cmbCatalog.Items.Add(
                    new DriveComboItem(
                        exObject.Name,
                        ((exObject is DriveObject) ? 1 : 0),
                        ((exObject is DriveObject) ? ((DriveObject)exObject).ImageIndex : gView.Explorer.UI.Framework.UI.ExplorerIcons.ImageIndex(exObject)),
                        exObject
                        ));
            }

            //cmbCatalog.Items.Add(new CatalogComboItem("Computer", 0, 0, null));

            //ManagementObjectSearcher query = new ManagementObjectSearcher("SELECT Name,DriveType From Win32_LogicalDisk ");
            //ManagementObjectCollection collection = query.Get();

            //foreach (ManagementObject manObject in collection)
            //{
            //    DriveObject exObject = new DriveObject(manObject["Name"].ToString(), (uint)manObject["DriveType"]);
            //    cmbCatalog.Items.Add(new DriveComboItem(exObject.Name, 1, exObject.ImageIndex, exObject));
            //}

            //ComponentManager compMan = new ComponentManager();
            //foreach (XmlNode exObjectNode in compMan.ExplorerObjects)
            //{
            //    IExplorerObject exObject = (IExplorerObject)compMan.getComponent(exObjectNode);
            //    if (!(exObject is IExplorerGroupObject)) continue;

            //    cmbCatalog.Items.Add(new ExplorerObjectComboItem(exObject.Name, 0, FormExplorer.ImageIndex(exObject), exObject));
            //}

            cmbCatalog.SelectedIndex = 0;
        }
Beispiel #7
0
        public void InitTreeView(bool expand)
        {
            if (this.InvokeRequired)
            {
                InitTreeViewCallback d = new InitTreeViewCallback(InitTreeView);
                this.Invoke(d, new object[] { expand });
            }
            else
            {
                treeView.Nodes.Clear();

                ComputerObject computer = new ComputerObject(_app);
                treeView.Nodes.Add(new ExplorerObjectNode(computer, 0));

                if (expand)
                {
                    treeView.Nodes[0].Expand();
                }
                treeView.SelectedNode = treeView.Nodes[0];
            }
        }
Beispiel #8
0
        public Response(ComputerObject _Comp, List<UserObject> UserLst)
        {
            if (UserLst.Count == 1)
            {
                var User = UserLst[0];
                Name = User.Name;
                Email = User.Email;
                Telephone = User.Telephone;
                Jobtitle = User.JobTitle;
                Department = User.Department;
                Sid = User.ObjectSid;
            }

            Comps = _Comp.Name;
        }