validationIIS或ISS网站的最佳方法是?
我们有一个内部IIS服务器,托pipe几个网站,redirect到外部托pipe的Web应用程序。 有时候人们会做重要的事情,如重新启动服务器,停止服务,拔掉电缆,你把它命名它发生….我想validation我们的内部IISnetworking服务器启动并运行每15分钟,如果不尝试重新启动服务并给我发一封电子邮件。 我写了这个PowerShell脚本,但不知道这是否是完成这个最好的方法? ################################################################### # Summary: Verify W3SVC service is running, send email if it's down ################################################################### ############################## # Get service status ############################## $serviceName = "W3SVC" $serverName = hostname $status = (Get-Service $serviceName).Status if ($status -ne "Running"){ sendMail "$serviceName" "$serverName" #sendmail is a function (not shown) Restart-Service $ServiceName }else{ # Service is running, do nothing; […]