문제

사용자 정보 목록과 SharePoint 2013 기반의 목록을 채우고 싶습니다.사용자 정보 목록은 /_catalogs/user/simple.aspx (siteuserinfolist)에서 발견되며 사용자의 모든 항목이 포함됩니다.

이 작업을 수행하는 방법에 대한 아이디어는 무엇입니까?

도움이 되었습니까?

해결책

콘솔 기반 응용 프로그램이나 타이머 작업에서 Server Object 모델을 사용할 수 있습니다. 사용자 목록의 모든 값 가져 오기

자세한 내용은이

C #을 사용하여 대상 목록에 항목을 추가 할 수 있습니다. 코드는 여기

다른 팁

The url provided is basically a oob list that contains all the user information. That means you can fetch an instance of it and perform normal list operations with it.

If using server object model, this is the code I lifted from Code Project and modified.

SPUser sUser = myweb.CurrentUser;
SPList UserList = SPContext.Current.Web.SiteUserInfoList;

SPList targetList = SPContext.Current.Web.Lists["target"];

foreach(SPListItem item in UserList.Items.GetItems()) 
{
  var newItem = targetList.Items.Add();
  newItem["UserName"] = item.Name;
  //populate column values;
  newItem.Update();
}

If you want to use different object model then there is comphrensive guide to working with list and list items using different object models : Here

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 sharepoint.stackexchange
scroll top