简体   繁体   English

如何自动附加到远程服务器上的特定IIS池?

[英]How do you automatically attach to a specific IIS pool on remote server?

Currently three developers share one IIS box for testing. 当前,三个开发人员共享一个IIS盒进行测试。 Because of third party utils and other restrictions we can't run the project locally so remote debugging is the only option. 由于第三方工具和其他限制,我们无法在本地运行项目,因此远程调试是唯一的选择。 Our current process is to remote to the webserver, run iisapp.vps to get the PID of our individual sites and then run remote debugging in VS2008, to connect to that pid. 我们当前的过程是远程访问Web服务器,运行iisapp.vps获取我们各个站点的PID,然后在VS2008中运行远程调试以连接到该pid。

I have found scripts for automatically connecting to w3wp automatically, if it's the only one running however I haven't found a way to be able to remotely find the w3wp PID in script and use that to attach. 我已经找到了用于自动连接到w3wp的脚本,如果它是唯一运行的脚本,但是我还没有找到一种方法可以远程找到脚本中的w3wp PID并使用它来附加。

Most of the scripts that work with IIS assume that you are running on the local machine. 与IIS一起使用的大多数脚本都假定您正在本地计算机上运行。 If you look in the script code it's most likely using WMI to work with IIS and the first thing it has to do is connect to WMI provider which always requires a machine name and a WMI provider path. 如果您查看脚本代码,则最有可能使用WMI与IIS一起使用,并且它要做的第一件事就是连接到WMI提供程序,该程序始终需要计算机名称和WMI提供程序路径。 The machine name for the local machine is often represented as "." 本地计算机的计算机名称通常表示为“。” where required. 在需要的地方。

For Example: 例如:

strComputer = "." 
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" _
    & strComputer & "\root\cimv2")

Set colProcesses = objWMIService.ExecQuery( _
    "select * from win32_process Where Name = 'w3wp.exe'" )
For Each objProcess in colProcesses
    WScript.Echo objProcess.ProcessId

If you change strComputer to point to the IIS server, you will get the PIDs for all of the w3wp processes running at the time of the query. 如果将strComputer更改为指向IIS服务器,则将获得查询时运行的所有w3wp进程的PID。

Note: the above code is a fragment of a script not a complete program. 注意:上面的代码是脚本的片段,而不是完整的程序。

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

相关问题 如何将IIS应用程序池标识用户区域设置为ApplicationPoolIdentity时,如何设置它 - How do you set the IIS Application Pool Identity User Locale when it's set to ApplicationPoolIdentity 每当重新加载应用程序域时,您如何强制 IIS 应用程序池重新启动? - How do you force the IIS Application Pool to restart whenever the App Domain is reloaded? 如何将调试器附加到IIS而不是ASP.NET Development Server? - How do I attach the debugger to IIS instead of ASP.NET Development Server? 一种应用程序,用于获取托管在远程服务器中的网站的IIS和应用程序池详细信息 - An Application which fetches IIS and App Pool details of website hosted in remote server IIS应用程序池访问网络上的远程目录 - IIS application pool access to remote directory on network 尝试自动连接到远程Web服务器时发生意外的DCOM错误 - An unexpected DCOM error occurred while trying to automatically attach to the remote web server 如何利用IIS应用程序池中的空闲CPU时间? - How do I exploit idle CPU time in an IIS App Pool? 如何在IIS 7.5中配置应用程序池时它会在停止时自动重新启动? - How to config application pool in IIS 7.5 automatically re-start when it was stopped? 如何提高IIS池的性能? - How to increase IIS pool performance? IIS Web 服务器和线程池问题 - IIS web server and thread pool issues
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM