快速导出iis域名列表

请先将IIS的配置导出来,并命名为IIS.XML,然后放在下面这个asp文件同目录,之后打开这个文件即可浏览。
程序代码 程序代码
<%option explicit
dim fso
Set FSO = Server.CreateObject("Scripting.FileSystemObject")
dim ts
Set ts = fso.OpenTextFile(server.MapPath("iis.xml"),1)  '修改此处的iis备份文件名即可,同目录下哦
dim content
content= ts.ReadAll
content=split(content,"<IIsWebServer")

function getdomain(str)
dim reg,readstr,matches,match1
set reg=new Regexp
reg.Multiline=True
reg.Global=false
reg.IgnoreCase=true
reg.Pattern="ServerComment(.*)\s"
Set matches = reg.execute(str)
  For Each match1 in matches
   readstr=match1.Value
  Next
Set matches = Nothing
Set reg = Nothing
getdomain=replace(readstr,"ServerComment=","")
getdomain=replace(getdomain,"""","")
end function

function GetKey(HTML,Start,Last)
dim filearray,filearray2
filearray=split(HTML,Start)
filearray2=split(filearray(1),Last)
GetKey=filearray2(0)
End function

function Clear(content)
dim arr,i
arr=split(content,":")

for i=0 to ubound(arr)
if instr(arr(i),".")>0 then
Clear=Clear & arr(i)
end if
next
end function

response.Clear()
response.Write "本服务器共有"&ubound(content)-2&"个站点<br>"
dim i
for i=0 to ubound(content)
if instr(content(i),"ServerBindings")>0 then
response.Write (i)&" 描述:"&getdomain(content(i))&" 主机头:"&Clear(GetKey(content(i),"ServerBindings=""",""""))&"<br><br>"
end if
next
%>



文章来自: 本站原创
引用通告: 查看所有引用 | 我要引用此文章
Tags:
相关日志:
评论: 0 | 引用: 0 | 查看次数: -
发表评论
昵 称:
密 码: 游客发言不需要密码.
内 容:
验证码: 验证码
选 项:
虽然发表评论不用注册,但是为了保护您的发言权,建议您注册帐号.
t