使用ASP列出NT用户组及用户
程序员文章站
2023-11-29 18:23:34
============================================================= '  ...
=============================================================
' 感谢您使用asp001工作室开发的实用函数程序
' http://www.asp001.net
'============================================================= 'asp001工作室为您提供订制程序开发、企业互联网拓展服务
'qq:1974229
'e-mail:shenyangchuqi@tom.com
'更多程序下载请到http://www.asp001.net
'=============================================================
'函数介绍:列出nt用户组及用户
'本函数使用adsi,需要administrators组用户权限
'函数名称:listgroup(computer)
'程序开发:asp001工作室 chuqi
'用法: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
' 感谢您使用asp001工作室开发的实用函数程序
' http://www.asp001.net
'============================================================= 'asp001工作室为您提供订制程序开发、企业互联网拓展服务
'qq:1974229
'e-mail:shenyangchuqi@tom.com
'更多程序下载请到http://www.asp001.net
'=============================================================
'函数介绍:列出nt用户组及用户
'本函数使用adsi,需要administrators组用户权限
'函数名称:listgroup(computer)
'程序开发:asp001工作室 chuqi
'用法: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