如何在ADSI中查询用户属性?
程序员文章站
2022-05-03 15:38:23
如何在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
%>
上一篇: 我图的是什么啊
下一篇: 不知道她是红的还是白的