$Server = "ServerName"
$AppPoolName = "AppPoolName"
$iisVersion = Get-ItemProperty "HKLM:\software\microsoft\InetStp";
if ($iisVersion.MajorVersion -eq 7)
{
##IIS7
$Name = "W3SVC/APPPOOLS/$AppPoolName"
$Path = "IISApplicationPool.Name='$Name'"
Invoke-WMIMethod Recycle -Path $Path -Computer $Server -Namespace root\MicrosoftIISv2 -Authentication PacketPrivacy
}
else
{
##IIS6
$appPool = get-wmiobject -namespace "root\MicrosoftIISv2" -class "IIsApplicationPool" | Where-Object {$_.Name -eq "W3SVC/APPPOOLS/$AppPoolName"}
$appPool.Recycle()
}
The normal things can be done to create your views in SCOM so that the guys can look at the performance view of their specific servers AppPools as well as Alerts as per the normal setup you would do.
Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.
Comments (0)