Hi,
I want to recycle app pool whose pid is found utilizing high memory…
#Get App pool and Process Id
$x=Get-WmiObject -NameSpace ‘root\WebAdministration’ -class ‘WorkerProcess’| select AppPoolName,ProcessId
#Get top 3 process ids utilizing high memory
$y=Get-Process | Sort-Object -Descending WS| select -first 3|select Id
Now if ($x.ProcessId is in $y.Id)
{ Find app pools name and recycle}
else
{Nothing found}
I am unable to compare and find the app pool name. Could you please help me?