Exchange Server | Murat Bilici

"Empower your knowledge"

Get-ProcessUpTime

Get-ProcessUpTime için aşagıdaki scripti kullanabilirsiniz.

function Get-ProcessUpTime {

param ($processName=”*”)

$WhereFilter = {$_.ProcessName -like $processName}

ForEach ($process in (Get-Process | Where $WhereFilter)) {

try {

$UpTime = ((Get-Date).Subtract($process.StartTime)).TotalMinutes

} catch {

$UpTime = “Cannot Determine UpTime”

} finally {

New-Object PSObject -Property @{

ProcessName = $process.ProcessName

UpTime = $UpTime

}

}

}

}

 

Get-ProcessUpTime power*

# Results

ProcessName    UpTime

———–    ——

powershell         35

powershell_ise     12

Categories: Exchange 2010 - Powershell