从C ++获取工作进程的应用程序池名称 [英] Get the application pool name of a worker process from C++

查看:81
本文介绍了从C ++获取工作进程的应用程序池名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


Hi ,


我正在使用IIS 8在我的机器上。

I am using IIS 8 in my machine.


i想从C ++获取工作进程的应用程序池名称。 


首先我以普通用户的身份打开了visual studio,我在我的c ++程序中尝试了如下,

First i opened the visual studio as normal user, i tried in my c++ program as below,

system("c:\\Windows\\System32\\inetsrv\\appcmd.exe list wp > c:\\temp\\test.txt")



我没有从此获得输出。访问被拒绝。

I didn't get output from this. access denied.


当我以管理员身份打开visual studio时。它正在工作。

when i open the visual studio as administrator. it's working.


 我如何以普通用户的身份实现这一目标?

 How can i achieve this as normal user?


 有没有办法从C ++获取工作进程的应用程序池名称?

 Is there a way to get the application pool name of a worker process from C++ ?



谢谢,

推荐答案

感谢您在此处发帖。

>>我没有从此获得输出。访问被拒绝。

当我以管理员身份打开视觉工作室时。它正在工作。



 我如何实现这一点普通用户?

 有没有办法从C ++获取工作进程的应用程序池名称?

AppCmd.exe是单一命令行工具。要访问该工具,您最好使用管理员权限启动命令行提示符,这可能与AppCmd.exe工具的安全设计有关。

AppCmd.exe is the single command line tool. To access the tool,  you'd better launch the command line prompt with administrator rights, this may be related to the security design with AppCmd.exe tool.

有关安全问题的详细信息,您可能需要在IIS论坛上发帖以获得更好的支持。

For more information about the security issue, you may need to post on IIS forum for better support.

https://forums.iis.net/

使用c ++,您可以使用
LogonUser
登录管理员的方法。

With c++, you could use LogonUser method to log an administrator on.

你也可以使用
ADSI
,使用IISApplicationPool接口查询应用程序池名称。

You could also use ADSI with IISApplicationPool Interface to query the application pool name.

希望这可以帮助您。

最诚挚的问候,

Baron Bi


这篇关于从C ++获取工作进程的应用程序池名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆