【发布时间】:2020-04-15 11:49:27
【问题描述】:
我需要多次更改 OU 的描述> 我们不能使用 PowerShell。如何通过 System.DirectoryServices 检查和更改 OU 描述;和 C#
【问题讨论】:
标签: c# directoryservices
我需要多次更改 OU 的描述> 我们不能使用 PowerShell。如何通过 System.DirectoryServices 检查和更改 OU 描述;和 C#
【问题讨论】:
标签: c# directoryservices
使用对象的可分辨名称(以LDAP:// 为前缀)创建一个 DirectoryEntry 实例。例如:
var directoryEntry = new DirectoryEntry("LDAP://ou=YourOU,dc=company,dc=com");
directoryEntry.Properties["description"].Value = "new description";
directoryEntry.CommitChanges();
【讨论】: