c# - Convert Distinguished Name to Canonical Name -


System.DirectoryServices (अर्थात DirectoryEntry वर्ग) का उपयोग करना है जिस तरह से सक्रिय निर्देशिका उपयोगकर्ता & amp; में विशिष्ट नाम विशेषता को परिवर्तित करने के लिए, या कैनोनिकल नाम प्राप्त करने का तरीका। कंप्यूटर स्नैप-इन? मुझे लगता है मैं नियमित अभिव्यक्तियों का उपयोग कर ऐसा कर सकता हूं, लेकिन मैं एक अधिक विश्वसनीय दृष्टिकोण को पसंद करता हूं। उदाहरण के लिए, मैं इसे

CN = Murdock, James, OU = अक्षम उपयोगकर्ताओं, ओयू = GOG, DC = contoso, DC = स्थानीय

इस

contoso.local / GOG / निष्क्रिय उपयोगकर्ताओं / मर्डोक, जेम्स

यह एक निर्मित विशेषता है निर्देशिकाईंट्री पर, आपको ताज़ा करेंकैश का उपयोग करना होगा:

  var de = new DirectoryEntry ("CN = Murdock \", जेम्स, ओयू = अक्षम उपयोगकर्ता, ओयू = जीओजी, डीसी = कॉन्सोटा, डीसी = स्थानीय "); de.RefreshCache (नई स्ट्रिंग [] {"canonicalName"});    

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -