Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
SharePoint 2010用户/组超过REST_Rest_Sharepoint - Fatal编程技术网

SharePoint 2010用户/组超过REST

SharePoint 2010用户/组超过REST,rest,sharepoint,Rest,Sharepoint,是否有一种通过REST检索站点用户/组列表的方法,类似于使用listdata.svc获取列表数据的方法?我想获取站点上所有用户和组的列表,这样我就可以输入用户输入的名称(例如John Smith),然后我可以将该名称映射到相关的用户ID(例如John Smith的ID:3),以便在推送列表项更新时使用,因为您必须为此使用ID。答案是肯定的。下面是使用rest的teh codez 仅限团体: [Site]/_vti_bin/Listdata.svc/UserInformationList?$fil

是否有一种通过REST检索站点用户/组列表的方法,类似于使用listdata.svc获取列表数据的方法?我想获取站点上所有用户和组的列表,这样我就可以输入用户输入的名称(例如John Smith),然后我可以将该名称映射到相关的用户ID(例如John Smith的ID:3),以便在推送列表项更新时使用,因为您必须为此使用ID。

答案是肯定的。下面是使用rest的teh codez

仅限团体:

[Site]/_vti_bin/Listdata.svc/UserInformationList?$filter=substringof('SharePointGroup',ContentType) eq true 
仅限人员:

[Site]/_vti_bin/Listdata.svc/UserInformationList?$filter=substringof('Person',ContentType) eq true
两者:

使用这些方法中的任何一种,您都可以获得id和更多信息

<m:properties>
  <d:ContentTypeID>0x010....</d:ContentTypeID>
  <d:Name>Doe, John</d:Name>
  <d:Account>ABC\john.doe</d:Account>
  <d:WorkEMail>jd@abc.com</d:WorkEMail>
  <d:MobilePhone m:null="true" />
  <d:AboutMe m:null="true" />
  <d:SIPAddress m:null="true" />
  <d:IsSiteAdmin m:type="Edm.Boolean">false</d:IsSiteAdmin>
  <d:Deleted m:type="Edm.Boolean">false</d:Deleted>
  <d:Picture m:null="true" />
  <d:Department m:null="true" />
  <d:Title m:null="true" />
  <d:FirstName>John</d:FirstName>
  <d:LastName>Doe</d:LastName>
  <d:UserName>John.Doe</d:UserName>
  <d:WebSite m:null="true" />
  <d:AskMeAbout m:null="true" />
  <d:WorkPhone>8885551212</d:WorkPhone>
  <d:Office m:null="true" />
  <d:Unit m:null="true" />
  <d:Id m:type="Edm.Int32">2</d:Id>
  <d:ContentType>Person</d:ContentType>
  <d:Modified m:type="Edm.DateTime">2016-09-27T00:00:19</d:Modified>
  <d:Created m:type="Edm.DateTime">2013-10-17T12:13:59</d:Created>
  <d:CreatedById m:type="Edm.Int32">3</d:CreatedById>
  <d:ModifiedById m:type="Edm.Int32">1073741823</d:ModifiedById>
  <d:Owshiddenversion m:type="Edm.Int32">217</d:Owshiddenversion>
  <d:Version>1.0</d:Version>
  <d:Path>/sites/test/_catalogs/users</d:Path>
</m:properties>

0x010。。。。
多伊,约翰
ABC\john.doe
jd@abc.com
假的
假的
约翰
雌鹿
约翰·多伊
8885551212
2.
人
2016-09-27T00:00:19
2013-10-17T12:13:59
3.
1073741823
217
1
/站点/测试/目录/用户

Hi Joe,如何使用listdata.svc从sharepoint组获取用户列表,有帮助吗?
<m:properties>
  <d:ContentTypeID>0x010....</d:ContentTypeID>
  <d:Name>Doe, John</d:Name>
  <d:Account>ABC\john.doe</d:Account>
  <d:WorkEMail>jd@abc.com</d:WorkEMail>
  <d:MobilePhone m:null="true" />
  <d:AboutMe m:null="true" />
  <d:SIPAddress m:null="true" />
  <d:IsSiteAdmin m:type="Edm.Boolean">false</d:IsSiteAdmin>
  <d:Deleted m:type="Edm.Boolean">false</d:Deleted>
  <d:Picture m:null="true" />
  <d:Department m:null="true" />
  <d:Title m:null="true" />
  <d:FirstName>John</d:FirstName>
  <d:LastName>Doe</d:LastName>
  <d:UserName>John.Doe</d:UserName>
  <d:WebSite m:null="true" />
  <d:AskMeAbout m:null="true" />
  <d:WorkPhone>8885551212</d:WorkPhone>
  <d:Office m:null="true" />
  <d:Unit m:null="true" />
  <d:Id m:type="Edm.Int32">2</d:Id>
  <d:ContentType>Person</d:ContentType>
  <d:Modified m:type="Edm.DateTime">2016-09-27T00:00:19</d:Modified>
  <d:Created m:type="Edm.DateTime">2013-10-17T12:13:59</d:Created>
  <d:CreatedById m:type="Edm.Int32">3</d:CreatedById>
  <d:ModifiedById m:type="Edm.Int32">1073741823</d:ModifiedById>
  <d:Owshiddenversion m:type="Edm.Int32">217</d:Owshiddenversion>
  <d:Version>1.0</d:Version>
  <d:Path>/sites/test/_catalogs/users</d:Path>
</m:properties>