zoukankan      html  css  js  c++  java
  • 导出IIS Log列表,导出站点下虚拟目录列表

    Add-Type -AssemblyName System.Web
    import-module webadministration
    $ip = (gwmi Win32_NetworkAdapterConfiguration -Filter "IPEnabled='true'" | ? {$_.DefaultIPGateway -ne $null}).IPAddress[0]
    #导出所有站点的IISLog目录列表到IISLog.htm文件
    $html = Get-Website|Select @{Label="Website";Expression={$_.Name}}, @{Label="IIS Log";Expression={'<a href="http://' + $ip + ":11000/W3SVC" + $_.id + '">' + "http://" + $ip + ":11000/W3SVC" + $_.id + '</a>'}} 
    |sort Website |ConvertTo-Html
    $html = $html | % { if($_ -match 'a href' ) { [System.Web.HttpUtility]::HtmlDecode($_) } else { $_ } }
    $html  |out-file d:iislogIISLog.htm -Force
    
    #导出IISLog站点下的虚拟目录列表到APPLog.htm文件
    $html_app = Get-WebVirtualDirectory -site "IISLog" |Select @{Label="LogName";Expression={($_.path).replace("/","")}}, @{Label="Log";Expression={'<a href="http://' + $ip + ":11000" + $_.path + '">' + "http://" 
    + $ip + ":11000" + $_.path + '</a>'}} |sort LogName |ConvertTo-Html
    $html_app = $html_app | % { if($_ -match 'a href' ) { [System.Web.HttpUtility]::HtmlDecode($_) } else { $_ } }
    $html_app  |out-file d:iislogAPPLog.htm -Force

    IISlog

    APPLog

  • 相关阅读:
    卡特兰数
    Tree
    关于树上DP的转移方式与复杂度证明
    Tarjan进阶
    排队
    Perm 排列计数
    [bzoj1227]虔诚的墓主人
    [BZOJ1195]最短母串
    ValueError: Variable vgg_16/conv1/conv1_1/weights already exists, disallowed
    《链家网技术架构的演进之路》读后感
  • 原文地址:https://www.cnblogs.com/dreamer-fish/p/4866645.html
Copyright © 2011-2022 走看看