【问题标题】:Change description of an OU via System.DirectoryServices C#通过 System.DirectoryServices C# 更改 OU 的描述
【发布时间】:2020-04-15 11:49:27
【问题描述】:

我需要多次更改 OU 的描述> 我们不能使用 PowerShell。如何通过 System.DirectoryServices 检查和更改 OU 描述;和 C#

【问题讨论】:

    标签: c# directoryservices


    【解决方案1】:

    使用对象的可分辨名称(以LDAP:// 为前缀)创建一个 DirectoryEntry 实例。例如:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-01-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-11-10
      • 2016-11-06
      • 2018-03-05
      • 1970-01-01
      相关资源
      最近更新 更多