Export the IIS log list and export the list of virtual directories under the site

Source: Internet
Author: User

Add-type-AssemblyName System.webimport-Module Webadministration$ip= (Gwmi Win32_NetworkAdapterConfiguration-Filter "ipenabled= ' true '"| ? {$_. DefaultIPGateway-ne $null}). Ipaddress[0]#Export the IISLog directory list of all sites to the iislog.htm file$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-fileD:\iislog\IISLog.htm- Force#Export the list of virtual directories under the IISLog site to the applog.htm file$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-fileD:\iislog\APPLog.htm-Force

IISLog

Applog

Export the IIS log list and export the list of virtual directories under the site

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.