=============================================================
' 感謝您使用ASP001工作室開發的實用函數程序
' HTTP://WWW.ASP001.NET
'============================================================= 'ASP001工作室為您提供訂制程序開發、企業互聯網拓展服務
'QQ:1974229
'E-Mail:
[email protected] '更多程序下載請到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