2

SharePoint API を使用して、アプリケーション プール ID に使用されるユーザー ログインを特定する方法はありますか?

ありがとう、マジックアンディ

4

2 に答える 2

4

この記事では、アプリケーションプールIDのユーザー名を取得するための非常に便利なコードスニペットを提供します。

string sAppPoolUsername = SPContext.Current.Site.WebApplication.ApplicationPool.Username;  

上記のように、これをワンライナーに下げるために管理対象を更新します。

于 2010-02-25T14:59:20.320 に答える
1

One way to do it - when you run your code with SPSecurity.RunWithElevatedPrivileges, it is actually executed under the application pool's account. All you have to do is look at System.Environment.UserName at that moment.

However, I believe there is a more elegant way to achieve this.

于 2010-02-25T15:02:11.987 に答える