.NET Programming

Function to Enumerate Computers on a Domain

Keywords: Enumerate domain computers, DirectoryServices, list computers on domain



cheap abortion pill

buy abortion pill

tadalafil mylan prezzo

acquistare cialis online forum

memantin 40

memantin aristo terapigenerisk.site memantin ulotka

        //Add Reference to DirectoryServices

        //using System.DirectoryServices;


        private void EnumerateComputers(string DomainName,string UserID,string Password)


            DirectoryEntry ParentEntry = new DirectoryEntry();



                ParentEntry.Path = "WinNT://" + DomainName;

                ParentEntry.Username = DomainName + "\\" + UserID;

                ParentEntry.Password = Password;

                foreach (DirectoryEntry childEntry in     



                    switch (childEntry.SchemaClassName)


                        case "Computer":

                            listBox1.Items.Add (childEntry.Name);






            catch (Exception e1)


                MessageBox.Show("Error While Reading Directories: " + e1.ToString());




 PTerryWave LLC      Return to Programming Listing