<%

const ADS_SCOPE_SUBTREE = 2
Set objConnection = CreateObject("ADODB.Connection")
Set objCommand =   CreateObject("ADODB.Command")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
Set objCommand.ActiveConnection = objConnection
objCommand.CommandText = _
    "Select Name,CN from 'LDAP://DC=nmc,DC=ln,DC=cmcc' " _
        & "where objectClass='user' and Name='徐中'" 
objCommand.Properties("Page Size") = 1000
objCommand.Properties("Timeout") = 30
objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE
objCommand.Properties("Cache Results") = False
Set objRecordSet = objCommand.Execute
objRecordSet.MoveFirst
Do Until objRecordSet.EOF
    Response.Write "Name: " & objRecordSet.Fields("Name").Value & "<br>"
    Response.Write "CN: " & objRecordSet.Fields("CN").Value & "<br>"
    objRecordSet.MoveNext
Loop

%>

 

整理中...


文章来源:http://ms.mblogger.cn/xuzhong/posts/16799.aspx

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-24
  • 2021-08-07
  • 2022-12-23
  • 2021-10-28
  • 2022-12-23
猜你喜欢
  • 2021-10-15
  • 2021-06-22
  • 2022-12-23
  • 2021-08-30
  • 2022-12-23
  • 2022-12-23
  • 2021-12-14
相关资源
相似解决方案