'=============================================================
'函数介绍:列出NT用户组及用户
'本函数使用ADSI,需要Administrators组用户权限
'函数名称:ListGroup(Computer)
'用法:ListGroup(计算机名称)
'例:显示127.0.0.1计算机NT用户组及用户
'ListGroup "127.0.0.1"
'=============================================================
Function ListGroup(Computer)
response.write "<p><b>以下为计算机"&Computer&"系统用户组及用户列表</b></p>"
Set ComputerObj = GetObject("WinNT://"&Computer)
ComputerObj.Filter = Array("Group")
For Each Member in ComputerObj
Response.Write "用户组:"&Member.Name&"<br>"
ListUser Computer,Member.Name
Next
end Function
'列出指定用户组用户
Function ListUser(Computer,Group)
Set UserObj = GetObject("WinNT://"&Computer&"/"&Group)
For Each Member in UserObj.Members
Response.write " 组中用户:"&Member.Name &"<br>"
Next
End Function
<script type="text/javascript"> </script> <script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script>