开发者

how to get the identity with which a .vbs or a .asp file executes from within itself?

开发者 https://www.devze.com 2023-01-24 11:56 出处:网络
I am looking for a way to get the identity of the process which executes a *.vbs file or a *.asp file. How to write code to determine the process identity from within the file itself? Suppose I execut

I am looking for a way to get the identity of the process which executes a *.vbs file or a *.asp file. How to write code to determine the process identity from within the file itself? Suppose I execute the file, it should output the full name of the user (i.e. domain\username).

I've taken a look at this code, but it lists all the processes and then displays the identity of each process. I don't think this is appropriate: if I use the same code in an asp file and executed it via a browser request, I am thinking it would be hard to determine which process is exactly executing it.

EDIT: hope this should explain m开发者_运维问答y requirement better -> what if I wanted my script file asp/vbscript to be run by a particular user and not anyone else?!


Think this might solve at least part of your problem. This is taken from an answer on Google Answers:

You can grant them access to the site based on their Windows log-in simply by unenabling Anonymous access and enabling Integrated Windows authentication in the IIS console -> Anonymous access and authentication control -> Edit... dialogue.

Once authenticated with Integrated Windows, you can get their username through Request.ServerVariables("LOGON_USER").

0

精彩评论

暂无评论...
验证码 换一张
取 消