您的当前位置:首页 > 软件资讯

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

2020-07-31 05:40:52
'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 " Size=5 Color=Blue>"&UCASE(DomainString)&"内的所有组的列表" doc.title=UCASE(DomainString) & " - 组" Set DomainObj = GetObject("WinNT://" & DomainString) tmp= DomainObj.MinPasswordLength 'verify this is a valid domain if err.number<>0 then write " There was an error connecting to " & domainname & "!" set ie=Nothing wscript.quit end if DomainObj.Filter = Array("group") strInfo="组名描述 " ie.StatusText="正在收集信息,请稍候......" For Each GroupObj In DomainObj If GroupObj.Class = "Group" Then strInfo=strInfo&""&GroupObj.Name&"Size=3>"&GroupObj.Description&"" End If Next set DomainObj = Nothing set GroupObj = Nothing strInfo=strInfo & "" write strInfo & "" write "" & Now & "" set ie=Nothing set doc=Nothing wscript.quit '****************** sub write(str) doc.body.insertAdjacentHTML "beforeend", str end sub