使用ASP列出NT用户组及用户
时间:2021-06-13 08:46:13|栏目:ASP代码|点击: 次
=============================================================
' 感谢您使用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