How to Load the Required SharePoint Assemblies – PowerShell

Sathish Nadarajan
 
Solution Architect
May 14, 2016
 
Rate this article
[Total: 0    Average: 0/5]
 
Views
6206

In this article, let us see how to Load the required assemblies before executing the PowerShell.

Almost many of the below assemblies will be required to be loaded before any of the Script execution.

 [System.Reflection.Assembly]::Load("Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c") 
 [System.Reflection.Assembly]::Load("Microsoft.SharePoint.Portal, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c")
 [System.Reflection.Assembly]::Load("Microsoft.SharePoint.Publishing, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c") 
 [System.Reflection.Assembly]::Load("Microsoft.SharePoint.AdministrationOperation, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c") 
 [System.Reflection.Assembly]::Load("Microsoft.Office.InfoPath.Server, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c") 
 [System.Reflection.Assembly]::Load("Microsoft.Office.Server, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c") 
 [System.Reflection.Assembly]::Load("Microsoft.Office.InfoPath, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c") 
 
 [void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.InfoPath.Server")
 [void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
 

Happy Coding,

Sathish Nadarajan.

Category : PowerShell, SharePoint

Author Info

Sathish Nadarajan
 
Solution Architect
 
Rate this article
[Total: 0    Average: 0/5]
 
Sathish is a Microsoft MVP for SharePoint (Office Servers and Services) having 13+ years of experience in Microsoft Technologies. He holds a Masters Degree in Computer Aided Design and Business ...read more
 

Leave a comment