AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Win32/Win64 API (native code) System.DirectoryServices.Protocols: Attributwert löschen
Thema durchsuchen
Ansicht
Themen-Optionen

System.DirectoryServices.Protocols: Attributwert löschen

Ein Thema von Phoenix · begonnen am 30. Sep 2008 · letzter Beitrag vom 30. Sep 2008
 
Benutzerbild von Phoenix
Phoenix
(Moderator)

Registriert seit: 25. Jun 2002
Ort: Hausach
7.644 Beiträge
 
#2

Re: System.DirectoryServices.Protocols: Attributwert löschen

  Alt 30. Sep 2008, 12:31
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.
Sebastian Gingter
Phoenix - 不死鳥, Microsoft MVP, Rettungshundeführer
Über mich: Sebastian Gingter @ Thinktecture Mein Blog: https://gingter.org
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 00:46 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz