当前位置: 首页 > 图文教程 > 网络编程 > ASP > 取得服务器上用户组列表脚本之VBS版

ASP
用asp怎样编写文档搜索页面(5)
用asp怎样编写文档搜索页面(6)
ASP.NET: XML计数器第二版
ASP.NET: XML留言版第二版
不用图像组件的ASP图像计数器
用ASP实现文档资料管理
用ASP实现号码转换程序实例
如何用SAFileUp上传文件?
jmail4.1用pop3收信的例子
功能非常全面的日期处理函数
一个检查E文拼写错误的Code
简单的加密方法:XOR
ASP连接执行程序
编写“公平”的ASP图形计数器
跟我学做最强功能的网站统计
用asp.net写的论坛程序
用asp.net写的论坛程序--论坛主页
用asp.net写的论坛程序--浏览贴及回复
用asp.net写的论坛程序--上贴保存
利用CDONTS发送邮件的ASP函数

ASP 中的 取得服务器上用户组列表脚本之VBS版


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 30 ::
收藏到网摘: n/a

  'groups.vbs
'时间:2001.2.5
'版本:1.0
'作者:沧海笑一声
'其它:此脚本原作者写于2000年初,沧海用过后觉得不是很好用.
'它原来的显示方式是wsh的方法,往往要多屏显示,而且不能保存结果
'我将之改成IE显示的方法,用起来方便些.:)

On Error Resume Next
'dim wshell
dim ie,doc

set ie = createobject("internetexplorer.application")
ie.navigate "about:blank"
ie.visible = true

set doc = ie.document

CRLF=CHR(13)+CHR(10)
DomainString =inputbox("请输入一个域名:")
msgbox "域名是:"&DomainString

write "<Table border=1 cellpadding=4 width=90% bgcolor=ffffcc><TR Align=Center><TD valign=top> <B><Font
Size=5 Color=Blue>"&UCASE(DomainString)&"内的所有组的列表</B></Font></td></tr></table>"
doc.title=UCASE(DomainString) & " - 组"

Set DomainObj = GetObject("WinNT://" & DomainString)
tmp= DomainObj.MinPasswordLength    'verify this is a valid domain
if err.number<>0 then
write "<Font Color=Red> There was an error connecting to " & domainname & "</Font>!<br>"
  set ie=Nothing
  wscript.quit
end if

DomainObj.Filter = Array("group")
strInfo="<Table border=0 cellpadding=5><TR><TD><B><Font Size=3>组名</Font></B></TD><TD><B><Font Size=3>描述
</Font></B></TD></TR>"
ie.StatusText="正在收集信息,请稍候......"
For Each GroupObj In DomainObj
    If GroupObj.Class = "Group" Then
       strInfo=strInfo&"<TR><TD><B><Font Size=3>"&GroupObj.Name&"</Font></B></TD><TD><B><Font
Size=3>"&GroupObj.Description&"</Font></B></TD></TR>"
    End If
Next
set DomainObj = Nothing
set GroupObj = Nothing
strInfo=strInfo & "</Table>"
write strInfo & "<br>"

write "<font size=1><I>" & Now & "</I></Font>"

set ie=Nothing
set doc=Nothing
wscript.quit

'******************
sub write(str)
  doc.body.insertAdjacentHTML "beforeend", str
end sub