Exploring SharePoint 2013 PowerShell Obfuscation

Exploring SharePoint 2013 PowerShell Obfuscation

By Somnath Saha  •  July 30, 2014  •  1746 Views

Netwoven Blog

When I am exploring the breadth of SharePoint 2013 PowerShell and would like to dig a little deeper to understand what each of the commands are doing and what set of command are available for given operation or area of SharePoint functionality, or would like to debug some of the run time issues you may incur, I like to explore with the .Net Reflector.

Here I wanted to provide you with some guidance on your way around exploring the SharePoint 2013 PowerShell.

Setup

  • First of all, of course you will need to have your SharePoint 2013 On Prem  installed and an existence of live farm .
  • You could use any commercial available Obfuscator tool. I use Red gate .NET Reflector.

Exploring

  • Run the .Net Reflector.
  • Locate the Powershell assembly as below. With .Net 4, the assembly location is now located under C:WindowsMicrosoft.NETassembly
  • For powershell assembly  locate the following folder

C:WindowsMicrosoft.NETassemblyGAC_MSILMicrosoft.SharePoint.PowerShellv4.0_15.0.0.0__71e9bce111e9429cMicrosoft.SharePoint.Powershell.dll

  • Once you have  loaded the PowerShell assembly, you will see following name spaces
Exploring SharePoint 2013 PowerShell Obfuscation
  • In order to look up the usual SharePoint Command Lets such as Get/Set/New/Delete/Remove commands look below under the SPCmdlet groups to locate your desired command
Exploring SharePoint 2013 PowerShell Obfuscation
  • Lets explore one of the commandlet we all use Add-SPSolution.
  • So locate the SPCmdLetAddSolution as below:
Exploring SharePoint 2013 PowerShell Obfuscation
  • On the Details pane you should see the method partial details as below
Exploring SharePoint 2013 PowerShell Obfuscation
  • Now click on Expand Methods to further expand  the details of each method. Partial view below:
Exploring SharePoint 2013 PowerShell Obfuscation
  • Here under the SPSolution method you will see that there is call for _LocatFarm object which is based on the SharePoint Object Model.
  • So let’s click on the add method, and you will see that the call is pointing to the object model, and there you further explore the real call details.

Conclusion

Likewise, being able to explore the specific calls by knowing your API calls, you can further diagnose your Farm Issues, Configuration Issues and Development issues.

Leave a comment

Your email address will not be published. Required fields are marked *

Dublin Chamber of Commerce
Microsoft Partner
Microsoft Partner
Microsoft Partner
Microsoft Partner
Microsoft Partner
Microsoft Partner
Microsoft Fast Track
Microsoft Partner
MISA
MISA
Unravel The Complex
Stay Connected

Subscribe and receive the latest insights

Netwoven Inc. - Microsoft Solutions Partner

Get involved by tagging Netwoven experiences using our official hashtag #UnravelTheComplex