欢迎光临
我们一直在努力

送大家一个小脚本,非常实用。:)

建站超值云服务器,限时71元/月

user-ie.vbs

v2.6 jeffery hicks

jhicks@solutechinc.com

usage: cscript|wscript user-ie.vbs

desc: create on the fly html page in ie showing user account

information.

full name, password expiration and age are displayed for users in the

status bar

by passing mouse over username

on error resume next

dim ie,doc

set ie = createobject("internetexplorer.application")

ie.navigate "about:blank"

ie.visible = true

set doc = ie.document

hard code your domain name

注意在下面填写上要查询用户的域的名字.:)

否则不会正常工作的

domainname = "domainname"

write "<table border=1 cellpadding=4 width=90% bgcolor=ffffcc><tr

align=center><td valign=top> <b><font size=5 color=blue>user accounts

for " & ucase(domainname) & "</b></font></td></tr></table>"

doc.title=ucase(domainname) & " – user accounts"

set odomain = getobject("winnt://" & domainname)

verify this is a valid domain

if this code causes problems for a known good domain, comment out

everything

up to and include end if

if odomain.passwordhistorylength="" then

wscript.echo "there was an error connecting to " & domainname

write "<font color=red> there was an error connecting to " &

domainname & "</font>!<br>"

set ie=nothing

wscript.quit

end if

ie.statustext="working……"

odomain.filter = array("user")

strinfo="<table border=0 cellpadding=5><tr><td><b><font

size=3>username</font></b></td><td><b><font

size=3>description</font></b></td><td><b><font size=3>logon

script</font></td></b><td><b><font

size=3>lastlogin</font></b></td></tr>"

for each ouser in odomain

ie.statustext="working……"&ouser.name

if ouser.passwordexpirationdate="" then

pwexpire="never"

else

pwexpire=ouser.passwordexpirationdate

end if

detail=ouser.fullname & " password expires:" & pwexpire & "

password age:"&formatnumber(ouser.passwordage/86400,0) & " day(s)"

strinfo=strinfo & "<tr><td><font size=2 color=blue

onmouseover="&chr(34)&"status="&detail&"; "&chr(34)&

"onmouseout="&chr(34)&"status=done;"&chr(34)& ">" & ouser.name &

"</font></td><td><font size=2>" & ouser.description &

"</font></td><td><font size=2>" & ouser.loginscript &

"</font></td><td><font size=2>" & ouser.lastlogin & "</font></td></tr>"

next

ie.statustext="formatting results……"

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

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 送大家一个小脚本,非常实用。:)
分享到: 更多 (0)