Ah.. habs selber:
Code:
var modification = new DirectoryAttributeModification();
modification.Name = "member"; // Attributname
modification.Operation = DirectoryAttributeOperation.Delete;
foreach (entry in list)
{
if (NeedToDelete(entry)
modification.Add(entry);
}
if (modification.Count > 0)
{
try
{
var request = new ModifyRequest(LdapObject.DistinguishedName, modification);
ModifyResponse response = (ModifyResponse)LDAPConnection.SendRequest(request);
if (response.ResultCode != ResultCode.Success)
throw new InvalidOperationException("Ldap Error: " + response.ErrorMessage);
}
}
Damit werden nur die Werte aus dem Attribut gelöscht, die in der DirectoryAttributeModification angegeben wurden.