To get around it with the client Object Model you can use this code snippet, it uses item pos to leverage getting more than 5000K items. if you need VB.NET or more in-depth breakdown this is the site for you here The Snippet is from here
List list = ClientContext.Web.Lists.GetByTitle("Assets");
ListItemCollectionPosition itemPosition = null;
while (true) {
CamlQuery camlQuery = new CamlQuery();
camlQuery.ListItemCollectionPosition = itemPosition;
camlQuery.ViewXml = "<View>" + Constants.vbCr + Constants.vbLf + "<ViewFields>" + Constants.vbCr + Constants.vbLf + "<FieldRef Name='Id'/><FieldRef Name='Title'/><FieldRef Name='Serial_No'/><FieldRef Name='CRM_ID'/>" + Constants.vbCr + Constants.vbLf + "</ViewFields>" + Constants.vbCr + Constants.vbLf + "<RowLimit>2201</RowLimit>" + Constants.vbCr + Constants.vbLf + "</View>";
ListItemCollection listItems = list.GetItems(camlQuery);
clientcontext.Load(listItems);
clientcontext.ExecuteQuery();
itemPosition = listItems.ListItemCollectionPosition;
foreach (ListItem listItem in listItems) {
Console.WriteLine("Item Title: {0} Item Key: {1} CRM ID: {2}", listItem("Title"), listItem("Serial_x0020_No_x002e_"), listItem("CRM_ID"));
}
if (itemPosition == null) {
break; // TODO: might not be correct. Was : Exit While
}
Console.WriteLine(itemPosition.PagingInfo);
Console.WriteLine();
}