It seems that a recent Windows update violated some of the features that I used to recycle IIS6 application pools, as it worked for several months now.
Exception calling "Recycle" : "Win32: The object identifier does not representException calling "Recycle" : "Win32: The object identifier does not represent a valid object.
The function that I used to recycle application pools was:
function recycle-pool($strServerName)
{
$objWMI = [WmiSearcher] "Select * From IIsApplicationPool"
$objWMI.Scope.Path = "\\" + $strServerName + "\root\microsoftiisv2"
$objWMI.Scope.Options.Authentication = 6
$pools = $objWMI.Get()
foreach ($pool in $pools)
{
$pool.recycle()
if (!$?)
{
Write-Host $pool.name " - ERROR"
}
else
{
Write-Host $pool.name " - Recycled"
}
}
Any idea what the problem is and how should I approach this?
source
share