简体   繁体   English

通过 System.DirectoryServices C# 更改 OU 的描述

[英]Change description of an OU via System.DirectoryServices C#

I need to change several time the description of an OU> We can't use PowerShell.我需要多次更改 OU 的描述> 我们不能使用 PowerShell。 How do I check and change an OU description via System.DirectoryServices;如何通过 System.DirectoryServices 检查和更改 OU 描述; and C#和 C#

Create an instance of DirectoryEntry with the distinguished name of the object (prefixed with LDAP:// ).使用可分辨名称 object(前缀为LDAP:// )创建 DirectoryEntry 实例。 For example:例如:

var directoryEntry = new DirectoryEntry("LDAP://ou=YourOU,dc=company,dc=com");
directoryEntry.Properties["description"].Value = "new description";
directoryEntry.CommitChanges();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM