When installing AIF on a Dynamics AX 2009 server which is also a DC (Domain Controller), you gotta be careful, because, there are several issues regarding that.

This scenario shouldn't be common in a production environment, but, it is indeed quite common in a demo Virtual PC machine, where you have "everything in a box"...

So!, if you try to install AIF (AX 2009) and you get the following error:

"Setup was not completed", AIF Web Services Error:

image 

And then you drill down looking for the error in the LOG file:

"The input parameters to this method are: 'MicrosoftDynamicsAXAif50'
    Leaving method DeleteAppPool
    Leaving method Deconfigure
    The return value from this method is 'None'.
    Leaving method Configure
An error occurred during setup of AIF Web services.
Reason: Exception has been thrown by the target of an invocation
.
Restarting IIS"

But that is not very descriptive..

So, the problem is regarding the AOS Service account, which by default is usually"NT AUTHORITY\NETWORK SERVICE" account, but because of we are running on a DC Server, we should use any specific Domain account created just for running AOS services (be sure you grant required permissions to that domain account). If you change it, then you'll success installing AIF in AX 2009!. :-)