Permission problems after migrating from Apache to IIS
From here I got the idea to run the following command on a console ("Determining the account used as IIS anonymous identity"):

%windir%\system32\inetsrv\appcmd.exe list config "MyDrupalAppPool" ^ /section:anonymousAuthentication


The result was the following:

&lt;system.webServer&gt;
  &lt;security&gt;
    &lt;authentication&gt;
      &lt;anonymousAuthentication enabled="true" userName="IUSR" /&gt;
    &lt;/authentication&gt;
  &lt;/security&gt;
&lt;/system.webServer&gt;


And then running the following command seems to have solved the problem of writing to/deleting from the "files" directory:

icacls c:\&lt;mydrupalpath&gt;\sites\default\files /t /grant IUSR:(OI)(CI)(M)


I don't know if it's secure enough... Please leave comments if you think there is any kind of problem with this approach. Thanks.