SharePoint API を使用して、アプリケーション プール ID に使用されるユーザー ログインを特定する方法はありますか?
ありがとう、マジックアンディ
SharePoint API を使用して、アプリケーション プール ID に使用されるユーザー ログインを特定する方法はありますか?
ありがとう、マジックアンディ
この記事では、アプリケーションプールIDのユーザー名を取得するための非常に便利なコードスニペットを提供します。
string sAppPoolUsername = SPContext.Current.Site.WebApplication.ApplicationPool.Username;
上記のように、これをワンライナーに下げるために管理対象を更新します。
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.