[英]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.