简体   繁体   English

有没有办法以编程方式检查每个Web应用程序上一次在IIS中运行的时间?

[英]Is there a way to programmatically check the last time each web application was run in IIS?

We're trying to clean up some applications in IIS. 我们正在尝试清理IIS中的某些应用程序。 However, we're not sure when some of them were last ran. 但是,我们不确定其中一些何时最后一次运行。 Is there any way to programatically check to see when these applications were last run either through C# or even PowerShell? 有什么方法可以通过编程方式检查这些应用程序最后一次通过C#甚至PowerShell运行的时间吗? I'm not necessarily looking for a straight answer but pointing me in the right direction would help immensely. 我并不一定要寻找一个直接的答案,但是将我指向正确的方向将极大地帮助您。

Use WebAdministration module to get the location of the log files - 使用WebAdministration模块获取日志文件的位置-

This is an example of how to set the log file locations change the set to a get Powershell command to set IIS logging settings 这是一个如何设置日志文件位置并将设置更改为get Powershell命令以设置IIS日志记录设置的示例

Then cycle through the log files looking at the last modified date. 然后循环浏览日志文件,查看上次修改日期。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM