【问题标题】:Active directory VBS to VB活动目录 VBS 到 VB
【发布时间】:2015-02-16 15:40:19
【问题描述】:

您好,我需要将 VBS 脚本重写为 VB 文件,但我无法跟踪。

在 VBS 中是这样的:

Set OU = GetObject(LDAP_Path)
OU.Filter = Array("OrganizationalUnit")
For Each Item In OU
Description_OU = CStr(Item.Get("Description")) //Here is problem
...

在 VB (2010) 中使用“System.DirectoryServices”。因为我需要使用 Active Directory

我的问题:

Description_OU 有时是空的,我如何在 VB 中测试 Item 所在的位置:

Dim Item = System.DirectoryServices.DirectoryEntry

换句话说:我在 .DirectoryEntry 中找不到 "Description" 之类的东西

谢谢

【问题讨论】:

    标签: vb.net vbscript active-directory


    【解决方案1】:
    Item.Property("Description")(0).tostring
    

    “描述”=键

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-07-24
      • 1970-01-01
      • 2022-09-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-03-14
      • 1970-01-01
      相关资源
      最近更新 更多