快速导出iis域名列表
作者:刚子 日期:2010-04-28
请先将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
%>
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
%>
评论: 0 | 引用: 0 | 查看次数: -
发表评论
上一篇
下一篇

文章来自:
Tags: