質問

通常SP PowerShellから設定されているコードからChangeLetentionPeriod Stsadmプロパティを設定しようとしています。

コードからこのプロパティを設定するための最良の方法は何ですか?

背景:私は基礎インスタンスからSP 2010監査を利用し、管理者が監査設定を簡単に設定するためのUIフロントエンドを構築しようとしています(UIは使用できません。財団)

役に立ちましたか?

解決

Here is the MSDN,

basically

using(var site = new SPSite(SPContext.Current.Site.ID))
{
    var webapp = site.WebApplication;
    webapp.ChangeLogRetentionPeriod = new TimeSpan(1,0,0,0); // meaning 1 day
}

The code must be executed by a Farm Administrator account, so you might need to do som impersonification in the new SPSite statement, like new SPSite(SPContext.Current.Site.ID, farmAdminUserRetrievedBefore.UserToken)

ライセンス: CC-BY-SA帰属
所属していません sharepoint.stackexchange
scroll top