决战梭哈棋牌APP下载_决战梭哈棋牌官网 - 由决战梭哈棋牌APP下载,决战梭哈棋牌官网社主办的《决战梭哈棋牌APP下载,决战梭哈棋牌官网》是我国消费领域中一张全国性、全方位、大容量的综合性日报。其立足消费网投领域,依托轻工行业,面向城乡市场,最先发布相关的专业权威资讯。

IIS与ApplicationPool重启检测自动化解决方案

  • 时间:
  • 浏览:0

if($global:HotfixLog -is [array]){

if($global:HotfixTime){

Write-Host "-----------------------"

$global:Old=$global:Old+1

$global:W3WPStartTime=$global:W3WPSProcesses[$j].StartTime

    }

}

Write-Host "All the application pool(s) has been reset or new created after the 'Hotfix' updated."

$global:IISLogs|IISCK

end{

经历了一段时间的研究与学习,我终于完成了或多或少为检查打Hotfix事先agent端Application/IIS算是重启过的自动化除理方案,或者通过了几轮针对性的测试。将会有人 在使用过程中遇到了问題请联系我lync:tianyou lan

function CheckPool{

$global:IndexOfEnd=$global:nameofthepool.indexof('"')

$global:p=$global:p+1

function global:get-apppools{

$global:W3WPSProcesses=Get-Process -Name w3wp -ErrorAction SilentlyContinue

if($_.starttime -gt $global:HotfixTime){

$global:shortNameOfThePool=$global:nameofthepool.substring(0,$global:IndexOfEnd)

$global:IndexOfEnd=$global:nameofthepool.indexof('"')

下载地址:

Write-Host "Through the analysis from 'HotCheck':"

Write-Host "IIS has been reset after the 'Hotfix' updated."

}

Write-Host "No application pool has been reset or new created after the 'Hotfix' updated."

        $procid = $_.ProcessId

}

#最新W3Wptcp连接运行运行开启的时间

}

#将会有什么都有有的w3wptcp连接运行运行,取最新的那个。

if($global:i -ne 0){

if($_){

#获取w3wptcp连接运行运行所对应的Application pool(或多或少函数是在网上搜的)

Write-Host "Not all the application pool(s) has been reset or new created after the 'Hotfix' updated."

for($j=0;$j -lt $global:W3WPSProcesses.length;$j++){

}

if($global:p -ne 0){

    gwmi win32_process -filter 'name="w3wp.exe"' | % {

$global:Old=$global:Old+1

#将IISLogs倒入过滤器进行判断

if($global:New -eq $global:Old){

process{

}

感谢过程中得到的萌萌姐,Di Sun,Xue Pan在测试上的帮助;

}else{

$global:nameofthepool=(global:get-apppools|Where-Object {$_.pid -eq  $global:process.id}).apppoolid

$global:NewOrOldProcess=0

#i和p回会IISReset标记,0代表越来越重启过,或者代表重启过。i代表越来越Hotfix,p代表有Hotfix。

}

Write-Host "Through the analysis from 'HotCheck':"

1.右键tool,run as admin;前要联系我​:Tianyou.Lan

}

#只能另一五个 w3wptcp连接运行运行时,获取到w3wptcp连接运行运行的starttime。

$global:HotfixTime=$global:HotfixLog.TimeWritten

        $name=$_.name

$global:New=0

}else{

        New-Object psobject | Add-Member -MemberType noteproperty -PassThru Name $name |

$global:process=$_

#0位为最新的Hotfix时间

}

            Add-Member -MemberType noteproperty -PassThru AppPoolID $cmd |

if($_){

$global:HotfixTime=$global:HotfixLog[0].TimeWritten

Get-Process -Name w3wp -ErrorAction SilentlyContinue|CheckPool

}

$global:W3WPStartTime=0

$global:NewOrOldProcess=$global:NewOrOldProcess+1

$global:HotfixLog=Get-EventLog avepoint|Where-Object {$_.Category -like "*Update Manager*"}

Hotfix Automatic Check,简称Hot Check,"火柴"。

$global:New=$global:New+1

$global:nameofthepool=(global:get-apppools|Where-Object {$_.pid -eq  $global:process.id}).apppoolid

#判断结果

$global:i=0

    [regex]$pattern="-ap ""(.+)"""

if($global:NewOrOldProcess -ne 0){

if($global:New -lt $global:Old){

Write-Host "Since there're no 'Hotfix' updated, we don't need to care about whether the IIS has been reset yet."

}else{

Write-Host "The application pool [ $global:shortNameOfThePool ] has reset or the w3wp process of it is new created after the 'Hotfix' updated."

        $cmd = $pattern.Match($_.commandline).Groups[1].Value

Read-Host "Press any key to quit"

}

#filter,判断每十根日志,总的结果输出为i或p。

$global:shortNameOfThePool=$global:nameofthepool.substring(0,$global:IndexOfEnd)

#判断IIS算是在打Hotfix事先重启过

}

}

}

$global:process=$_

Write-Host "The application pool [ $global:shortNameOfThePool ] has not reset after the 'Hotfix' updated."

经历了:

}

}

感谢Lardy 哥给予的支持;

if($global:p -eq 0){

Write-Host "-----------------------"

$global:p=0

2.自动检测完成。

}

$global:Old=0

$global:IISLogs=Get-EventLog system| where-object {$_.source -like "*IIS*"}

}else{

}

}

filter IISCK{

if($global:W3WPSProcesses -is [array]){

if($global:W3WPSProcesses[$j].StartTime -gt $global:W3WPStartTime){

            Add-Member -MemberType noteproperty -PassThru PID $procid

}

if($global:i -eq 0){

Write-Host "IIS hasn't been reset after the 'Hotfix' updated."

Write-Host "Through the analysis from 'HotCheck':"

begin{

$global:i=$global:i+1

}else{

$global:W3WPStartTime=$global:W3WPSProcesses.StartTime

#最近另一五个 Hotfix开始英语 的时间

另:感谢DL的Dora Liu强力打包的五个针对性测试patch和Zhenpeng Liu的各种支持。

if($_.TimeWritten -gt $global:HotfixTime){

}

}

#$global:IISLogs=Get-EventLog system -After ((get-date).addhours(-5))| where-object {$_.source -like "*IIS*"}