To change the maximum results in an export file, open the web.config file. In the <appsettings> section of the file, add the following line:

<add key="WebShellAdHocQueryExportMaxRows" value="500000" />