Using the SharePoint Object Model, or With Great Power Comes Great Responsibility

As SharePoint developers, we all use the SharePoint (server) object model. If your code is executing in a Web context, i.e., in the w3wp.exe process space, you don’t have to read on.

But if you are writing server-side tools running as console/win forms applications or PowerShell scripts, you MUST be aware of the following:

  • Event handlers will execute in your process space, and “who knows what these handlers do?” What permissions are required for the code to execute successfully? And worst of all, will your process be alive long enough for the event handler code to finish???

  • Workflows will be triggered in your process space… See above for all of the caveats. Also read this blog from Yuan for more info about this topic.

 

I’m almost at a point where I think it is completely unsafe to write any sort of code similar to what I describe above if you can’t ensure that your code WON’T trigger ANY event handlers/workflows written a third party.

Microsoft states that the code must be executing under an administrator account and I wouldn’t try to tweak this since we don’t know anything about the third-party code that will be executing. In theory though, I don’t see how it won’t be enough to be running as an account member of the WSS_ADMIN_WPG group. But anything LESS than this won’t work UNLESS you know EVERYTHING about ANY code that might execute.

If you don’t know what events/workflows will be triggered, I would strongly advise you to use the Web Services / client-side object model instead. Now events and workflows will be executing in w3wp.exe.


SharePoint

Applications

SharePoint apps are stand-alone applications that perform specific tasks on a SharePoint site. Apps can perform functions such as managing a discussion board or knowledge base, performing project management or time tracking tasks, or doing other workflow operations.

SharePoint

Product Suites

Experience greater power and savings by bundling our SharePoint apps and web parts.


Essentials


Essentials Plus


Bamboo Premier


Project Management Suite


Knowledge Management Suite


External User Manager


SharePoint

Web Parts

Extend SharePoint beyond its out-of-the-box capabilities by tailoring it to your requirements with Bamboo Solution’s growing portfolio of Web Parts. Web Parts are the building blocks of pages on a SharePoint site that can be used to customize the user interface and content of a site page. 

SharePoint

Product Suites

Experience greater power and savings by bundling our SharePoint apps and web parts.


Essentials


Essentials Plus


Bamboo Premier


Project Management Suite


Knowledge Management Suite


External User Manager


Office 365

Cloud Parts

Cloud Parts are functional components that extend your SharePoint environment whether it’s hosted, on-premises, or part of Microsoft Office 365. More than mere ports of existing software to the cloud, our Cloud Parts have been built from the ground up to take advantage of the best that the cloud has to offer.

SharePoint

Product Suites

Experience greater power and savings by bundling our SharePoint apps and web parts.


Cloud Parts Suite for O365/SP Onl.


Featured Services

SharePoint Health Check

A SharePoint Health Check will identify the causes of issues and risks associated with your specific environment, and is custom tailored to provide you with the best recommendations to optimize your SharePoint environment.

SQL Health Check

Document recommendations relating to performance, stability, availability, or a specific focus you request of your SQL Server database instances.

My SharePointXperts

The truth is that each SharePoint skill may not be a full time job for many organizations, and it is nearly impossible for one person to do everything you need – so augment your team with SharePointXperts; providing the skill sets you need when you need them!