title: MSBuild Extension Pack IIS7 task on remote server error
body: <p>I have set up a Continuous Integration build with TeamCity and MSBuild. I am using the MSBuild Extension Pack, primarily for its IIS7AppPool Task. My goal is to stop an IIS app pool before the build script does a deployment step and start the app pool afterwards. The IIS app pool is on a different server from the build agent.</p>
  
  <p>I have used the following MS Build code to stop IIS:</p>
  
  <pre><code>&lt;MSBuild.ExtensionPack.Web.Iis7AppPool TaskAction="Stop" MachineName="$(DeploymentServerName)" Name="$(WebAppPoolName)" Username="$(DeploymentServerUsername)" UserPassword="$(DeploymentServerUserPassword)" /&gt;
  </code></pre>
  
  <p>I have set up a local admin user account on the web server, and used its username and password above as $(DeploymentServerUsername) and $(DeploymentServerPassword).</p>
  
  <p>The error I am receiving is:</p>
  
  <blockquote>
    <p>[MSBuild.ExtensionPack.Web.Iis7AppPool]
    E:\TeamCity\BuildAgent\work\1a1dc058c29f0f12\BuildAndDeployment\Build_DevCI.proj(153,
    5): UnauthorizedAccessException: Retrieving the COM class factory for
    remote component with CLSID {2B72133B-3F5B-4602-8952-803546CE3344}
    from machine DEPLOYMENTSERVERMACHINENAME failed due to the following
    error: 80070005 DEPLOYMENTSERVERMACHINENAME.</p>
  </blockquote>
  
  <p>I have asked our network guys to take down any firewalls between the two machines, but I still get the same error.</p>
  
  <p>Can anyone see anything wrong with my syntax or offer any advice on how to get this to work?</p>
  
  <p>I can get the task to stop an IIS app pool on my local machine ok, so my syntax should be right.</p>
  
  <p>I have looked at this post, but I don't think it's the same problem:</p>
  
  <p><a href="https://stackoverflow.com/questions/5616919/msbuild-remoting-to-server-throws-comexception-error">MSBuild remoting to server throws COMException error</a></p>