Are you installing the fresh Sitecore 9 and your script failed in the last step 14 of 14, and saying "The remote server returned an error: (500) Internal Server Error" or facing any of the below issues, then might be this post could be very useful for you.
- http://xp0.sc/sitecore/admin/PopulateManagedSchema.aspx?indexes=all: The remote server returned an error: (500)
- Sitecore 9 installation 503 error while requesting http://sc9u2.sc/sitecore/admin/PopulateManagedSchema.aspx?indexes=all
- Sitecore 9 Installation Fails on Step 14 of 14: "Error requesting http://sc9u2.sc/sitecore/admin/PopulateManagedSchema.aspx?indexes=all"
- "Handler "AutowiredPageHandlerFactory" has a bad module "ManagedPipelineHandler" in its module list"
- Error on UpdateSolrSchema step while calling PopulatedManagedSchema.aspx
We faced the similar error while installing Sitecore 9 Update 2, because I was configuring on the new machine with first time .Net/Sitecore installation.
The problem was due to missing ASP component (ASP, ASP.net 3.5 and ASP.net 4.7) on the IIS.
To install the missing component, follow the below steps:
Go to > Control Panel\Programs\Programs and Features
Click > Turn Window Features on or off
Navigate To > Internet Information Services > World Wide Web Services > Application development features
o Asp.net 3.5
o Asp.net 4.7
And make sure, all three above option should be checked, if not checked it and click OK.
Hope, it will resolve the issue.