title: Powershell - Error creating ServerManager object after windows updates
body: <p>HI,</p>
  
  <p>I have a powershell deployment script that downloads files from svn into a directory and then updates the IIS settings to point the site at the new folder. It has been running fine, until some updates were made to the server. Now, when I try and run the script it errors out on</p>
  
  <pre><code>[Void][Reflection.Assembly]::LoadWithPartialName("Microsoft.Web.Administration")
  $serverManager = New-Object Microsoft.Web.Administration.ServerManager
  </code></pre>
  
  <p>The error is</p>
  
  <pre><code>New-Object : Exception calling ".ctor" with "0" argument(s): 
  "Retrieving the COM class factory for component with CLSID {B15183DD-75F9-42DF-8E57-C8B57692F134} failed due to the following error: 80040154."
  At C:\Users\administrator.LAYERXNETWORKS\AppData\Local\Temp\2\e72ec49f-353f-4dc0-877c-ef67f6b49bab.ps1:2 char:28
  + $serverManager = New-Object &lt;&lt;&lt;&lt;  Microsoft.Web.Administration.ServerManager
      + CategoryInfo          : InvalidOperation: (:) [New-Object], MethodInvocationException
      + FullyQualifiedErrorId :    ConstructorInvokedThrowException,Microsoft.PowerShell.Commands.NewObjectCommand
  </code></pre>
  
  <p>I ahve read that this error is generally caused by the class not being installed.</p>
  
  <p>The server is running Windows 2008 R2 with IIS 7.5</p>