Deployment, PowerShell, Remoting, Scripting, Sharepoint, SharePoint2010
comments 2

Remote install of SharePoint 2010 prerequisites

I’ve published a free book on PowerShell 2.0 remoting. You can download it at:

Layman's guide to PowerShell 2.0 remoting 41864 downloads

Did you ever try installing SharePoint 2010 prerequisites remotely? If so, you would know by now that it is not easy. Essentially because of the Windows update packages in the prerequisites. It is a known issue that Wusa.exe cannot be invoked in a remote session. If you try to install SharePoint 2010 prerequisites remotely — either using PowerShell remoting or WMI — it fails with an error code 5.

We cannot really claim to have a fully unattended SharePoint deployment process until we have a solution to the prerequisite install process. So, with that background, I started working on the script for remotely installing SharePoint 2010 prerequisites. In today’s post, I will show you how to do that.

To achieve this, I used a combination of PsExec.exe and PowerShell remoting. Here are the prerequisites for this script to work.

  1. PowerShell remoting must be enabled the remote system where you are deploying SharePoint prerequisites.
  2. On the remote system, CredSSP must be enabled with Role set to Server.
  3. You need to download/copy PsExec.Exe to the same folder as the script in this post.
  4. Copy SharePoint 2010 install bits to a UNC share accessible from the remote computer and the prerequisiteinstaller.Arguments.txt file to install required prerequisites.
  5. Of course, you need to run this script with elevated privileges.

With no further delay, here is the script.

Save this to a .psm1 file. We can now run this script on the local system as shown here:

As you see above, I have used PsExec.exe to invoke a remote process. PsExec is unique in this case because it invokes the installer process on the remote machine as if it was invoked locally. Hence, the issues pertaining to remote invocation of Wusa.exe don’t bother us. What the script does is:

  1. Copy the prerequisite files to a temp folder on the remote computer
  2. Invoke prerequisiteinstaller.exe using PsExec.exe
  3. Wait for the prerequisiteinstaller.exe process on remote machine to exit
  4. Finally, verify the exit code and restart the remote computer, if required.

CredSSP is required because the script tries to access the UNC path where SharePoint 2010 install bits are stored. Also, observe how the script monitors the remote process.

Thanks to Oisin (@Oising) for this idea. I was struggling here to get the hold of remote process and using eventing made it really easy. Here is a screen capture of this script in action:

Prerequisite Deployment

Prerequisite Deployment

Finally, you can use the -restart parameter to automatically restart the system after prerequisite installation.

Once again, this is a very basic form of the script. Not even a complete advanced function. There is still some work to do. Things like,

  1. Complete comment based help
  2. Making it an advanced function
  3. Making this a part of PSSP2010Utils module

I will share the updates as I make some progress. Stay tuned.!

Filed under: Deployment, PowerShell, Remoting, Scripting, Sharepoint, SharePoint2010


Ravikanth is a principal engineer and the lead architect for Microsoft and VMware virtualized and hybrid cloud solutions within the Infrastructure Solutions Group at Dell EMC. He is a multi-year recipient of Microsoft Most Valuable Professional (MVP) award in Windows PowerShell (CDM) and Microsoft Azure. Ravikanth is the author of Windows PowerShell Desired State Configuration Revealed (Apress) and leads Bangalore PowerShell and Bangalore IT Pro user groups. He can be seen speaking regularly at local user group events and conferences in India and abroad.