ASP列出NT用户组及用户

来源:互联网 发布:云计算主题基金 编辑:程序博客网 时间:2024/06/05 16:32

'=============================================================    
'函数介绍:列出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 "&nbsp;&nbsp;&nbsp;&nbsp;组中用户:"&Member.Name &"<br>"
Next
End Function

 

 

 

<script type="text/javascript"><!--google_ad_client = "pub-4717125974896180";/* 728x90, 创建于 09-7-17 */google_ad_slot = "3536088218";google_ad_width = 728;google_ad_height = 90;// --></script><script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script>

原创粉丝点击