I was helping a client today to run scripts for creating web apps, site collections and service applications. Creating normal web applications and site collections worked fine but we got some troublesome errors when creating the service applications.
First we found that the "SharePoint Web Services Default" application pool was missing in the IIS and also when running "Get-SPServiceApplicationPool | select Id, Name". That seemed kind of strange so we decided to try to create a new application pool when creating a new Managed Metadata service application. This resulted in almost the same behaviour, no new app pool in the IIS but now the app pool was shown when running Get-SPServiceApplicationPool .
It seems like there is some error (security?) when trying to create Application Pools in the IIS for running Service Applications. We have checked and the security setup seems correct. Have anyone experienced this before?