一个利用adsi得到局域网信息的asp文件
程序员文章站
2022-06-19 19:29:12
<%@ language=vbscript %>
<%@ language=vbscript %>
<html>
<head>
<meta name="generator" content="microsoft visual studio 6.0">
<title>adsi domain browser</title>
</head>
<body>
<!-- author: adrian forbes -->
<%
sdomain = request("domain")
scomputer = request("computer")
sgroup = request("group")
suser = request("user")
if len(trim(suser)) > 0 then
set objgroup = getobject("winnt://" & sdomain & "/" & scomputer & "/" & suser)
for each objuser in objgroup.groups
response.write objuser.name & "<br>" & vbcrlf
next
response.write "</table><p><a href=adsi.?domain=" & sdomain & "&computer=" & scomputer & ">back to " & scomputer & "</a></p>"
elseif len(trim(sgroup)) > 0 then
set objgroup = getobject("winnt://" & sdomain & "/" & scomputer & "/" & sgroup)
for each objuser in objgroup.members
response.write objuser.name & "<br>" & vbcrlf
next
response.write "</table><p><a href=adsi.asp?domain=" & sdomain & "&computer=" & scomputer & ">back to " & scomputer & "</a></p>"
elseif len(trim(scomputer)) > 0 then
set objcomputer = getobject("winnt://" & sdomain & "/" & scomputer)
response.write "<table border=0>"
for each objobject in objcomputer
if strcomp(objobject.class, "group", 1) = 0 then
response.write "<tr><td>" & objobject.class & "</td><td> <a href=adsi.asp?domain=" & sdomain & "&computer=" & scomputer & "&group=" & objobject.name & ">" & objobject.name & "</a></td></tr>" & vbcrlf
elseif strcomp(objobject.class, "user", 1) = 0 then
response.write "<tr><td>" & objobject.class & "</td><td> <a href=adsi.asp?domain=" & sdomain & "&computer=" & scomputer & "&user=" & objobject.name & ">" & objobject.name & "</a></td></tr>" & vbcrlf
else
response.write "<tr><td>" & objobject.class & "</td><td> " & objobject.name & "</td></tr>" & vbcrlf
end if
next
<html>
<head>
<meta name="generator" content="microsoft visual studio 6.0">
<title>adsi domain browser</title>
</head>
<body>
<!-- author: adrian forbes -->
<%
sdomain = request("domain")
scomputer = request("computer")
sgroup = request("group")
suser = request("user")
if len(trim(suser)) > 0 then
set objgroup = getobject("winnt://" & sdomain & "/" & scomputer & "/" & suser)
for each objuser in objgroup.groups
response.write objuser.name & "<br>" & vbcrlf
next
response.write "</table><p><a href=adsi.?domain=" & sdomain & "&computer=" & scomputer & ">back to " & scomputer & "</a></p>"
elseif len(trim(sgroup)) > 0 then
set objgroup = getobject("winnt://" & sdomain & "/" & scomputer & "/" & sgroup)
for each objuser in objgroup.members
response.write objuser.name & "<br>" & vbcrlf
next
response.write "</table><p><a href=adsi.asp?domain=" & sdomain & "&computer=" & scomputer & ">back to " & scomputer & "</a></p>"
elseif len(trim(scomputer)) > 0 then
set objcomputer = getobject("winnt://" & sdomain & "/" & scomputer)
response.write "<table border=0>"
for each objobject in objcomputer
if strcomp(objobject.class, "group", 1) = 0 then
response.write "<tr><td>" & objobject.class & "</td><td> <a href=adsi.asp?domain=" & sdomain & "&computer=" & scomputer & "&group=" & objobject.name & ">" & objobject.name & "</a></td></tr>" & vbcrlf
elseif strcomp(objobject.class, "user", 1) = 0 then
response.write "<tr><td>" & objobject.class & "</td><td> <a href=adsi.asp?domain=" & sdomain & "&computer=" & scomputer & "&user=" & objobject.name & ">" & objobject.name & "</a></td></tr>" & vbcrlf
else
response.write "<tr><td>" & objobject.class & "</td><td> " & objobject.name & "</td></tr>" & vbcrlf
end if
next
上一篇: Python单元测试框架unittest简明使用实例
下一篇: 怎么吃生菜,生菜怎么吃减肥