How to solve the 0x80005000 error in C# gui

0

I get the unknow error (0x80005000) using this code:

 private void btn_verwijderGG_Click(object sender, EventArgs e)
    {
        string OUstring = ",ou="+bx_selOU1.SelectedItem.ToString();
        string GGstring = "cn="+txt_ggNaam.Text;

        if (DirectoryEntry.Exists("LDAP://" + GGstring + OUstring + ",DC=Roel,DC=gui"))
        {
            try
            {
                DirectoryEntry entry = new DirectoryEntry("LDAP://" + OUstring + ",DC=Roel,DC=gui");
                DirectoryEntry group = new DirectoryEntry("LDAP://" + GGstring + ",DC=Roel,DC=gui");

                entry.Children.Remove(group);
                group.CommitChanges();
            }
            catch (Exception a)
            {
                MessageBox.Show(a.Message.ToString());
            }
        }
        else
        {
            MessageBox.Show("Group Bestaat niet");
        }
    }

I tried using credentials but thats hasnt worked for me either. Can someone help me out?

c#
active-directory
asked on Stack Overflow Jan 15, 2020 by roeludh

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0