title: Microsoft Graph: How to receive list of remote items for drive?
body: <p>How can I quickly receive list of drive items that are <a href="https://dev.onedrive.com/facets/remoteitem_facet.htm" rel="nofollow noreferrer">remote items</a> (items that are links to items on other drives, shared with me items) ?</p>
  
  <p>Of course I can to do something like it:</p>
  
  <pre><code>// Universal version
  var res = new List&lt;DriveItem&gt;();
  var list = await Client.Me.Drive.Root.Children.Request().GetAsync();
  while (list != null)
  {
      res.AddRange(list.CurrentPage.Where(i =&gt; (i.RemoteItem != null)));
      list = (list.NextPageRequest != null) ? (await list.NextPageRequest.GetAsync()) : null;
  }
  return res;
  </code></pre>
  
  <p>But it too slow, and requires parse all items. Can I use filter to resolve this task? In other words, will code below work on all types of drives (OneDrive Personal, Business, SharePoint ...)?</p>
  
  <pre><code>// Filtered version
  var res = new List&lt;DriveItem&gt;();
  var list = await Client.Me.Drive.Root.Children.Request().Filter("remoteItem ne null").GetAsync();
  while (list != null)
  {
      res.AddRange(list.CurrentPage);
      list = (list.NextPageRequest != null) ? (await list.NextPageRequest.GetAsync()) : null;
  }
  return res;
  </code></pre>
  
  <p>According to OneDrive <a href="https://dev.onedrive.com/odata/filtering.htm" rel="nofollow noreferrer">documentation</a>:</p>
  
  <blockquote>
    <p>While the <strong>filter</strong> syntax can be used on <em>any property</em> of an item, we have optimized certain properties to be fast and efficient to filter on.</p>
    
    <p><strong>Note</strong>: In OneDrive for Business, SharePoint Online and SharePoint Server 2016, filtering support only <strong>name</strong> and <strong>url</strong> properties.</p>
  </blockquote>
  
  <p>Does it mean that OneDrive for Business and SharePoint aren't support filtering by <strong>remoteItem</strong> facet?</p>
  
  <p>Unfortunately Microsoft Grap <a href="https://developer.microsoft.com/en-us/graph/docs/overview/query_parameters#filter" rel="nofollow noreferrer">documentation</a> doesn't contain any additional information about it.</p>
  
  <p>P.S.: I don't have OneDrive Business account, so, sorry can't check my assumption.</p>