欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

如何在ADSI中查询用户属性?

程序员文章站 2023-01-25 17:32:54
如何在adsi中查询用户属性?<%dim x on error resume next'set x = g...

如何在adsi中查询用户属性?


<%
dim x

on error resume next
'set x = getobject("winnt://kenfilszwin2k/allen")
strldap="ldap://kenfilszwin2k/cn=allen he,ou=kenfilsz,dc=kenfilsz,dc=com"

set x=getobject(strldap)
response.write "object name: " & x.name & "<br>"
response.write "object class: " & x.class & "<br>"

set cls = getobject(x.schema)
for each op in cls.mandatoryproperties

' 返回用户对象必须设置的属性
  v = x.get(op)
  response.write "
必须设置:"& op & "=" &v & "<br>"
next
for each op in cls.optionalproperties

' 返回用户对象可选的属性
  v = x.get(op) 
  response.write "
可选:"& op & "=" &v & "<br>"
next
set cls=nothing
set x=nothing
response.end
%>