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

一个利用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