Create views in SharePoint that only show items created by current user

This is an oldie but a goodie in my opinion, this post will show you how to use library filters in SharePoint to only show items/ files created, or modified by the current user.

The steps below will guide you through the process of updating the view of a list or library to only show items created or modified by the current, logged in user.

  • Open the list or library you wish to update
  • From the library actions ribbon > select the current view (for example: all documents)
  • Press edit current view
  • Scroll down the edit view page until you get to the filter section
  • Create the following filter:

NOTE: this example will only show items that were created by OR modified by the current, logged in user. If you want your filter to only show items where both these values are true, change OR to AND.

  • Press OK to save your changes

Now your view should have updated to only show items created by, or modified by the current, logged in user.

Considerations

This example is really simple and easy to implement and there isn’t any real impact on your users as nothing is technically being restricted, just filtered out of the default view.

The flip-side of this is that in of itself could be considered a limitation if there is information stored within the list/ library that requires limited permissions. I’ll go into the options available for this later in this post.

However with that said, depending on what permissions you have in place for your list/ library, you could use this approach to secure the contents too.

Consideration #1 – Views don’t change permissions

A “back door” to gaining access to all contents stored in the list/ library would be to use a different view than the set default view to access all items (for example: if you created a new view to follow the below method, but left the default view set to show everything).

The solution to this would be to apply this filter approach to the default view, make sure any other public views follow the same approach and make sure end users don’t have elevated permissions.

Consideration #2 – Ensure permissions are set correctly

The only way an end user could bypass this approach without any “all items” views available, would be if they had the permissions to do so. The permission that controls this is called the Manage Lists permission, which is only granted via the Edit, Design, Full Control, Manage Hierarchy permission levels by default.

If end users aren’t in these groups, your in luck!

Consideration #3 – list/ library contents is not searchable

If you are using views to filter who can see contents within your list/ library then you will need to ensure this setting is updated if the contents needs to be hidden (below example is a document library):

  • Press the cog button > library settings
  • Press advanced settings
  • Under Search > change allow items from this document library to appear in search results to No
  • Press OK
Update the allow items from this document library to appear in search results advanced setting to ensure items aren’t visible in search.

Consideration #4 – If it’s a list, enable item level permissions

With lists, in advanced settings there is an additional configuration option – item level permissions which allows you to specify which items users can read and edit.

As the heading implies, this consideration only works for lists in SharePoint as the functionality isn’t available out the box for document libraries. SharePoint Maven have written up what the two different levels of item level permissions you can set mean, which you can find here.


Advertisement

Useful SharePoint URLs

This post is to serve as a reference point for all the useful shortcut URLs in SharePoint that help admins and super users get their jobs done much easier.

There are several blog posts by others with these URLs in them, but I wanted to preserve them in my own blog for future generations! Most of these links have come from SharePoint 2010, so if you want them to work in differing versions just add a 14, 15 or 16 after the layouts folder to work in 2010, 2013, 2016 or SharePoint Online.

Frequently used

TitleURL
Remove nav bar, header & command bar ?env=WebView (after .aspx)
Remove nav bar & header?env=Embedded
Open list/ library in Microsoft Lists?env=WebViewList
Site contents/_layouts/15/viewlsts.aspx
/_layouts/15/viewlsts.aspx?view=14 (old style view)
Manage content & structure/_layouts/sitemanager.aspx
Audit log reports /_layouts/Reporting.aspx?Category=Auditing
Shared with us/Shared%20Documents/Forms/AllItems.aspx?view=3

Users and permissions

TitleURL
People/_layouts/people.aspx
Groups/_layouts/groups.aspx
Site Collection Admins /_layouts/mngsiteadmin.aspx
Advanced Permissions /_layouts/user.aspx

Galleries

TitleURL
Site Columns/_layouts/mngfield.aspx
Site content types/_layouts/mngctype.aspx
Web parts/_catalogs/wp/Forms/AllItems.aspx
List templates/_catalogs/lt/Forms/AllItems.aspx
Master Pages/_layouts/ChangeSiteMasterPage.aspx
Themes/_catalogs/theme/Forms/AllItems.aspx
Solutions/_catalogs/solutions/Forms/AllItems.aspx

Site administration

TitleURL
Regional settings/_layouts/regionalsetng.aspx
Content and structure/_Layouts/sitemanager.aspx?Source={WebUrl}_layouts/settings.aspx
Content and structure logs/_Layouts/SiteManager.aspx?lro=all
Site libraries and lists/_layouts/mcontent.aspx
User alerts/_layouts/sitesubs.aspx
RSS/_layouts/siterss.aspx
Search and offline availability/_layouts/srchvis.aspx
Sites and workspaces/_layouts/mngsubwebs.aspx
Workflows/_layouts/wrkmng.aspx
Workflow settings/_layouts/wrksetng.aspx
Related Links scope settings/_layouts/RelLinksScopeSettings.aspx
Content Organizer Settings/_layouts/DocumentRouterSettings.aspx?Source=settings.aspx
Content Organizer Rules/RoutingRules/Group%20by%20Content%20Type.aspx
Site output cache/_Layouts/areacachesettings.aspx
Term store management/_Layouts/termstoremanager.aspx
Taxonomy Hidden List/Lists/TaxonomyHiddenList
Searchable columns/_Layouts/NoCrawlSettings.aspx

Look and feel

TitleURL
Welcome page/_Layouts/AreaWelcomePage.aspx
Title, description and icon/_layouts/prjsetng.aspx
Master page/_Layouts/ChangeSiteMasterPage.aspx
Page layouts and site templates/_Layouts/ChangeSiteMasterPage.aspx
Tree view/_layouts/navoptions.aspx
Site theme/_layouts/themeweb.aspx
Navigation/_layouts/AreaNavigationSettings.aspx

Site actions

TitleURL
Manage site features/_layouts/ManageFeatures.aspx
Reset to site definition/_layouts/reghost.aspx
Delete this site/_layouts/deleteweb.aspx
Site web analytics reports/_layouts/WebAnalytics/Report.aspx?t=SummaryReport&l=s
Site collection web analytics reports/_layouts/WebAnalytics/Report.aspx?t=SummaryReport&l=sc

Site collection administration

TitleURL
Search settings/_layouts/enhancedSearch.aspx
Search scopes/_layouts/viewscopes.aspx
Search keywords/_layouts/listkeywords.aspx
Site level recycle bin/_layouts/RecycleBin.aspx
Site collection recycle bin/_layouts/AdminRecycleBin.aspx
Site collection features/_layouts/ManageFeatures.aspx?Scope=Site
Site directory settings/_layouts/SiteDirectorySettings.aspx
Site hierarchy/_layouts/vsubwebs.aspx
Site collection navigation/_layouts/SiteNavigationSettings.aspx
Site collection audit settings/_layouts/AuditSettings.aspx
Audit log reports/_layouts/Reporting.aspx?Category=Auditing
Portal site connection/_layouts/portal.aspx
Site collection policies/_layouts/Policylist.aspx
Storage Metrics/_layouts/storman.aspx
Record declaration settings/_layouts/InPlaceRecordsSettings.aspx?Source=settings.aspx
Content type publishing/_Layouts/contenttypesyndicationhubs.aspx
Site collection cache profiles/_Layouts/RedirectPage.aspx?Target={SiteCollectionUrl}cache profiles
Site collection object cache/_Layouts/objectcachesettings.aspx
Content type service application error log/Lists/ContentTypeAppLog
Site collection output cache/_Layouts/sitecachesettings.aspx
Variations/_Layouts/VariationSettings.aspx
Variation labels/_Layouts/VariationLabels.aspx
Translatable columns/_Layouts/TranslatableSettings.aspx
Variation logs/_Layouts/VariationLogs.aspx
Suggested Content Browser Locations/PublishedLinks/
Document ID settings/_Layouts/DocIdSettings.aspx
SharePoint Designer Settings/_layouts/SharePointDesignerSettings.aspx
Visual Upgrade/_layouts/suppux.aspx
Help settings/_layouts/HelpSettings.aspx

Central administration

TitleURL
Manage web applications/_admin/WebApplicationList.aspx
Create site collections/_admin/createsite.aspx
Manage service applications/_admin/ServiceApplications.aspx
Manage content databases/_admin/CNTDBADM.aspx
Check job status/_admin/Timer.aspx
Manage farm administrators group/_layouts/people.aspx?MembershipGroupId=3
Configure service accounts/_admin/FarmCredentialManagement.aspx
Configure send to connections/_admin/OfficialFileAdmin.aspx
Configure content deployment paths and jobs/_admin/Deployment.aspx
Manage form templates_admin/ManageFormTemplates.aspx
Manage servers in farm/_admin/FarmServers.aspx
Manage services on server/_admin/Server.aspx
Manage farm features/_admin/ManageFarmFeatures.aspx
Configure alternate access mappings/_admin/AlternateUrlCollections.aspx
Perform a backup/_admin/Backup.aspx
Restore from backup/_admin/BackupHistory.aspx?restore=1&filter=1
Perform site collection backup/_admin/SiteCollectionBackup.aspx
Convert farm license type/_admin/Conversion.aspx
Check product and patch installation status/_admin/PatchStatus.aspx
Check upgrade status/_admin/UpgradeStatus.aspx

Common actions

TitleURL
Create new_layouts/spscreate.aspx
_layouts/create.aspx
View lists_layouts/viewlsts.aspx
Create site groups _layouts/permsetup.aspx
Quick launch_layouts/quiklnch.aspx
Workflow history list/lists/Workflow History
SharePoint server version + patch level/_vti_pvt/Service.cnf (run at site collection level)
Web part maintenance mode?Contents=1 (classic)
?maintenancemode=true (modern)
Save as site template_layouts/savetmpl.aspx
Manage user alerts_layouts/AlertsAdmin.aspx

REST API examples

OperationSharePoint REST API endpoint
Site
Get a SharePoint Site Collectionhttps://%5Byour site url]/_api/site
Get a specific site or webhttps://%5Byour site url]/_api/web
Get a sites titlehttps://%5Byour site url]/_api/title
List
Get all lists from a sitehttps://%5Byour site url]/_api/web/lists
Get all items from a listhttps://%5Byour site url]/_api/web/lists/getbytitle(‘listname’)/items
Get a lists titlehttps://%5Byour site url]/_api/web/lists/getbytitle(‘listname’)?select=Title
Get all columns within a listhttps://%5Byour site url]/_api/web/lists/getbytitle(‘listname’)/Fields
Get list from GUIDhttps://%5Byour site ur]}/_api/Web/Lists(‘list GUID here’)
Get list item by IDhttps://%5Byour site ur]}/_api/Web/Lists/GetByTitle/(‘listtitle’)/GetItemById(2)
Get selected fields for list itemshttps://%5Byour site ur]}/_api/Web/Lists/GetByTitle/(‘listtitle’)/Items?select=ID,Title
User
Get current user informationhttps://%5Byour site url]/_api/web/currentUser
Get all site usershttps://%5Byour site url]/_api/Web/siteusers
Group
Get all groups from the sitehttps://%5Byour site url]/_api/Web/siteusers/sitegroups
Get group by group IDhttps://%5Byour site url]/_api/Web/sitegroups/GetById(GroupId)
Get all users from grouphttps://%5Byour site url]/_api/Web/sitegroups(Id)/users
Source: SP guides

How to open SharePoint pages in maintenance mode

This post demonstrates how to access the web part maintenance page for a classic and modern SharePoint site to delete any problem web parts.

Classic SharePoint

Recently I came across an issue with a SharePoint 2010 publishing site. The site had a page on it that was being edited and after a series of web parts were added, crashed and would no longer load. An additional issue here was that there wasn’t another, recent version of the page to restore to.

So, in the steps below detail how I was able to access the page using web part maintenance mode and delete the problem web part:

  • Navigate to the problem page’s URL
  • At the end of the URL add ?contents=1
  • This will then open the problem page up in web part maintenance mode. From here you are able to close, restore defaults or delete web parts from your page

NOTE: make sure you page is checked out before trying this else you won’t be able to make any changes.

  • Select the web part(s) which you think are causing the issue
  • Now select to either close, reset or delete the web part. I chose delete
  • A warning message will appear > press OK

Modern SharePoint

When writing this post I wondered if this method of accessing web part maintenance mode still worked for modern SharePoint – the answer was no! When you try to open a modern page using ?contents=1 you get this:

Opening modern SharePoint pages in classic maintenance mode won’t work.

However, after reading this handy article from Microsoft about maintenance for client-side web parts in SharePoint Online I just switched my query to ?maintenancemode=true and it worked!

Modern web parts have there own query to append to the page URL to access maintenance mode.

Different to the classic example, modern web parts when in maintenance mode show summary, manifest and data tabs with information about each web part.

If you wish to delete a web part from this view you will need to edit the page and delete it from there, then republish like in the example below:

Deleting web parts in maintenance mode within a modern SharePoint page.

SharePoint URL’s

There are loads of URL’s that either I can never remember or haven’t come across that are listed here. However I wanted to keep a list of them on my site just for reference:

DestinationURL
Site Settings/_layouts/settings.aspx
Site Contents/_layouts/viewlsts.apx
Save Site as a Template/_layouts/savetmpl.aspx
View All People/_layouts/people.aspx?MembershipGroupId=0
View People and Groups/_layouts/groups.aspx
Workflows/_layouts/wrkmng.aspx
Workflow Health/_layouts/15/workflowservicehealth.aspx
Workflow History (Hidden)/lists/Workflow%20History
Create New Site items/_layouts/create.aspx
Manage Site Collection Admin Permissions/_layouts/mngsiteadmin.aspx
View Sites and Workspaces/_layouts/mngsubwebs.aspx
Manage User Permissions/_layouts/user.aspx
Recycle Bin/_layouts/RecycleBin.aspx
Second-Stage Recycle Bin (w/ Admin Permissions)/_layouts/AdminRecycleBin.aspx
Manage Site Content and Structure/_layouts/sitemanager.aspx
Manage Site Content Types/_layouts/mngctype.aspx
Manage Site Columns/_layouts/mngfield.aspx
Quick Launch Settings/_layouts/quiklnch.aspx
Navigation Settings/_layouts/AreaNavigationSettings.aspx
Web Analytics Reports (Site Usage Summary)/_layouts/usage.aspx
Manage Site Collection Features/_layouts/ManageFeatures.aspx?Scope=Site
Manage Site Features/_layouts/ManageFeatures.aspx
Application page for registering SP Apps/_layouts/appregnew.aspx
Sign in as a different user/_layouts/closeConnection.aspx?loginasanotheruser=true
Enable SharePoint Designer/_layouts/SharePointDesignerSettings.aspx
Welcome Page/_layouts/AreaWelcomePage.aspx
Change Site Master Page/_layouts/ChangeSiteMasterPage.aspx
Page Layouts and Site Templates/_Layouts/AreaTemplateSettings.aspx
Force Display the User Profile in the Site Collection/_layouts/userdisp.aspx?id={UserID}&Force=True
Site App Permissions/_layouts/15/appprincipals.aspx?Scope=Web
List Template Gallery/_catalogs/lt
Master Page Gallery/_catalogs/masterpage
Solution Gallery/_catalogs/solutions/
Web Part Gallery/_catalogs/wp
Get SharePoint Server Version/_vti_pvt/Service.cnf
Taxonomy List (Hidden)Lists/TaxonomyHiddenList/AllItems.aspx
Quick Deploy ItemsQuick%20Deploy%20Items/AllItems.aspx
Web Part Maintenance Page?Contents=1
Filter Toolbar (For Lists and Libraries)?Filter=1
Load Ribbon Tab (In a Document Library or List)?InitialTabId=Ribbon.Document
Show Page in a Dialog?isdlg=1
Display List in Grid View (In Document Library or List)?ShowInGrid=True
Open Page in Edit Mode?ToolPaneView=2

Problems creating list or library views based on created date

The situation

Data retention and deletion…I’m sure this is a something that anyone involved in Office 365, SharePoint on information management in general gets fed up of saying since the recent GDPR legislation!

Recently we have been rationalising and cleaning up our data in preparation for moving to Office 365. We are starting with SharePoint as the first target repository or silo of content.

The general consensus is to delete files and folders over 7 years old unless there is a pre-existing data retention policy to adhere to. So the next task is to identify those files that fall within our threshold, and ultimately delete.

Luckily, we have Tree Size Pro and ShareGate so I was able to relatively easily identify the files in question (there were a lot!).

The setup

As our SharePoint environment is a) rather full; and b) rather old, I made the decision to incrementally delete files rather than en-masse to mitigate risk, targeting the lists/libraries containing the most out of date content. I started by creating a view in the first library – library A with the following parameters:

  • Standard library view
  • Filtered by Created Date if less than or equal to 01/01/2011
  • Folders or Flat: Show items inside folders
    Show this view: In all folders

(all other settings are left default)

Results this returned looked good, I could see folders and files in this view that matched the criteria – brilliant! Based on my previous statement I decided to delete in batches out of working hours, again to mitigate risk. I deleted first from library A, then from the first stage and finally from the second stage recycle bin all in this fashion.

The problem

I had permanently deleted around 50% of the total volume of content to be deleted from library A when we started to receive reports of current files being ‘missing’ from library A…not a good day.

After these reports were investigated they were indeed true. It turns out that when folders are included within a library view, folders that match the filter will be shown in the view, regardless of whether the files inside match.

We tested the view exluding folders and all the files returned matched the filter criteria. The same results were demonstrated from a SharGate report of the same nature. The report of all files over 7 years old brought back folders over 7 years old, but they also contained files that were newer.

Conclusion

At present, we are not entirely sure as to why these filters are not able to drill down past a top-level folder. It appears to be difficult to specify via view settings to only show files within folders, including the folder itself that matches the criteria.

We have decided to omitt folders from our reports and views going forward and to solely focus on files as this is the most reliable way we can delete files.

Bonus: for those of you with ShareGate, heres an example of my report we created to bring back all files over 7 years old, excluding folders. I ran this report across the entire intranet application over a weekend and it worked a treat 🙂

SG-report

SharePoint and Nintex workflows failing on start pt.2 **FULLY RESOLVED**

It’s back again…a few months ago a wrote about my experiences with workflows failing on start after a .NET security update that was applied. You can read that post here:

SharePoint and Nintex workflows failing on start

Recently, the same .NET security update was applied to our SharePoint 2010 farm, which in turn caused the failing on start error to present itself again across all the workflows in the farm.

After identifing the issue soon after the update was applied, we decided to follow the same tact as before and roll back the patches, restart the servers and re-test the workflows – However, this time the results were different.

What was different?

Previously, rolling back the security update and any other patches added during this time, plus restarting the servers “fixed” the issue. This time, the same process did not yeald the same results and the workflows were still broken.

After performing the steps above, we observed that standard SharePoint workflows with a pause started to run sucessfully again, but Nintex workflows with a pause step either failed on start, or completed but errored after the pause step and sent an error notification.

Example 1 of nintex workflow with pause step failing on start
Example 2 of nintex workflow with pause step erroring, but completing

How we fixed it…

So this time we followed the updated step-by-step guide provided below on how to update the web.config files and OWS timer files via Add-CodeDomAuthorizedTypeToOWSTimerConfig.ps1 PowerShell script on the SharePoint Application server.


https://blogs.msdn.microsoft.com/rodneyviana/2018/10/12/step-by-step-video-on-how-to-fix-the-sharepoint-workflow/

We ran the script as recommended, which re-added the assemblies and dependancies to the OWSTimer config file and the web.config files on associated web servers and this in fact fixed the issue! As the script does an IIS reset/ Timer Job recycle we didnt even need to restart the servers!

I hope the that tidbit regarding the nintex workflow pauses helps someone else 🙂

File naming restrictions in SharePoint

This post is a reference point for all the restrictions and limitations around the restrictions that apply to file names and file types in SharePoint and OneDrive.

When uploading files into SharePoint or OneDrive that are subject to any of the restrictions, you may receive an error similar to something like this:

filename-error

What are the restrictions?

Restrictions have become more difficult to untangle in Microsoft 365 with SharePoint and OneDrive, plus the ability to sync. The key takeaway is that the entire decoded file path, including the file name can’t contain more than 400 characters. This limit applies to the combination of the folder path + file name after decoding:

  • The entire decoded path can’t contain more than 400 characters
  • File uploads cannot exceed 250GB
  • You can’t share more than 50,000 items
  • You can’t copy or move more than 100GB in total, no more than 30,000 files and each file must be less than 15GB

Invalid characters, file or folder names

  • ” * : < > ? / \ | all aren’t allowed in file or folder names, plus leading or trailing spaces
  • # & are supported and can be enabled in the SharePoint admin center
  • .lockCONPRNAUXNULCOM0 – COM9LPT0 – LPT9_vti_desktop.ini, any filename starting with ~$. are not allowed for files or folders
  • forms” isn’t supported when the folder is at the root level for a library
  • You can’t create a folder name in SharePoint that begins with a tilde (~)

Blocked file types

  • There are currently no known types of files that cannot be added to a list or library in SharePoint Online. Custom scripting must be allowed for custom script file extensions to be work
  • Temporary TMP files will not be synced to OneDrive
  • Files that are used by your local computer, such as desktop.ini on Windows or .ds_store on macOS, don’t normally sync
  • Outlook .PST files are supported, however they are synced less frequently compared to other file types to reduce network traffic

File uploads, names and path length

  • The file size limit for uploads is 250GB
  • Each segment of a path cant exceed 255 characters if files are synced to a PC or Mac
  • The length of the root folder in OneDrive, or synced SharePoint library, plus the relative path of the file (up to 400 characters) cannot exceed 520 characters
  • In SharePoint Server, the entire path of files can’t exceed 260 characters
  • Thumbnails are not generated for images larger than 100 MB
  • PDF previews are not generated for files larger than 100 MB

Sharing

  • There is a limit of 50,000 items that can be shared within a folder and any sub-folders
  • You can’t synchronize the Shared with me view grouping of files from a OneDrive for work or school site

Syncing, copying or moving files

  • Although SharePoint Online can store 30 million documents per library, for optimum performance Microsoft recommend syncing no more than 300,000 files across all document libraries. Additionally, performance issues can occur if you have 300,000 items or more across all libraries you are syncing, even if you are not syncing all items in those libraries.
  • If you use the previous OneDrive for Business sync client (Groove.exe), the sync limit per library is 20,000 items (including 5,000 items per team site)
  • Differential sync is possible for Microsoft Office files in the new file format, .docx, .pptx, .xlsx
  • You cannot copy or move more than 100 GB of the total file size
  • You cannot copy or move more than 30,000 files
  • Each file being copied/ moved must be less than 15 GB
  • SharePoint libraries/ lists can hold 50,000 major versions and 511 minor versions
  • When using onedrive.com, you can only copy up to 2500 files at one time

How it used to be – restrictions in SharePoint Sever

Here are some, more specific restrcitions again applying to site collections, sub-sites, libraries or lists:

  • Can’t be longer than 128 characters
  • Can’t use: ~ # % & * { } \ : < > ? / + | ”
  • Can’t use: ~ ” # % & * : < > ? / \ { | }. in SharePoint 2013
  • Can’t use the period character consecutively in the middle of a file name (blah…blah.docx)
  • Can’t use the period character at the end of a file name
  • Can’t use the period character at the start of a file name
  • Can’t end with:

    .files

    _files
    -Dateien

    _fichiers

    _bestanden

    _file

    _archivos

    -filer

    _tiedostot

    _pliki

    _soubory

    _elemei

    _ficheiros

    _arquivos

    _dosyalar

    _datoteke

    _fitxers

    _failid

    _fails

    _bylos

    _fajlovi

References

https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file – Names, paths and namespaces by Microsoft

http://www.sysadminsblog.com/microsoft/file-name-length-and-character-restrictions-for-sharepoint/  – Original write up by Mischa Oudhof of Sysadminblog.com

SharePoint and Nintex workflows failing on start after .NET security update

Updated


I’ve wrote part two on this issue with my full resolution steps here:

SharePoint and Nintex workflows failing on start – part two


The problem


I had this issue myself in the last week where EVERY SINGLE workflow across the farm on premise stopped working. SharePoint Designer and Nintex workflows all reported “Failed to start” when triggered to run.

The workflows stopped working due to a series of .NET security updates Microsoft released in September 2018. Microsoft released a public KB article on this – with resolution steps which can be found below:

But also this msdn blog post contains all the solution scripts and steps that includes Nintex workflows also (transcript below):

I noticed shortly after the fix was implemented that some of my SharePoint designer workflows were exhibiting odd behaviour. For example the screenshot below shows a SharePoint desinger workflow that previously worked without issue or errors in the history after the fix was applied:

Someone on reddit had already spotted this which drew my attention to the common issue, this only presents itself for workflows with pause steps!

I will update this post with my findings once this latest fix is applied.

Symptom

After applying .NET Security Only patch to resolve CVE-2018-8421 (Remote Code Execution Vulnerability) , all SharePoint out of the box Workflows fail to execute and the log will show an error like this:

09/13/2018 01:59:07.57 w3wp.exe (0x1868) 0x22FC SharePoint Foundation Workflow Infrastructure 72fs Unexpected RunWorkflow: Microsoft.SharePoint.SPException: <Error><CompilerError Line=”-1″ Column=”-1″ Text=”Type System.CodeDom.CodeBinaryOperatorExpression is not marked as authorized in the application configuration file.” /><CompilerError Line=”-1″ Column=”-1″ Text=”Type System.CodeDom.CodeBinaryOperatorExpression is not marked as authorized in the application configuration file.” /><CompilerError Line=”-1″ Column=”-1″ Text=”Type System.CodeDom.CodeBinaryOperatorExpression is not marked as authorized in the application configuration file.” /><CompilerError Line=”-1″ Column=”-1″ Text=”Type System.CodeDom.CodeBinaryOperatorExpression is not marked as authorized in the application configuration file.” /><CompilerError Line=”-1″ Column=”-1″ Text=”Type System.CodeDom.CodeBinaryOperatorExpression is not marked as authorized in the application configuration file.” /><CompilerError Line=”-1″ Column=”-1″ Text=”Type System.CodeDom.CodeBinaryOperatorExpression is not marked as authorized in the application configuration file.” /><CompilerError Line=”-1″ Column=”-1″ Text=”Type System.CodeDom.CodeBinaryOperatorExpression is not marked as authorized in the application configuration file.” /><CompilerError Line=”-1″ Column=”-1″…

The error suggest that System.CodeDom.CodeBinaryOperatorExpression is not in the authorized types.

Cause

Workflow Foundation (WF) will only run workflows when all the dependent types and assemblies are authorized in the .NET config file (or added explicitly via code) under this tree:

<configuration>

<System.Workflow.ComponentModel.WorkflowCompiler>

<authorizedTypes>

<targetFx>

However, after the update, the following lines are necessary for SharePoint 2013 and beyond:

<authorizedType Assembly=”System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″ NameSpace=”System.CodeDom” TypeName=”CodeBinaryOperatorExpression” Authorized=”True” />

<authorizedType Assembly=”System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″ NameSpace=”System.CodeDom” TypeName=”CodePrimitiveExpression” Authorized=”True” />

<authorizedType Assembly=”System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″ NameSpace=”System.CodeDom” TypeName=”CodeMethodInvokeExpression” Authorized=”True” />

<authorizedType Assembly=”System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″ NameSpace=”System.CodeDom” TypeName=”CodeMethodReferenceExpression” Authorized=”True” />

<authorizedType Assembly=”System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″ NameSpace=”System.CodeDom” TypeName=”CodeFieldReferenceExpression” Authorized=”True” />

<authorizedType Assembly=”System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″ NameSpace=”System.CodeDom” TypeName=”CodeThisReferenceExpression” Authorized=”True” />

<authorizedType Assembly=”System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″ NameSpace=”System.CodeDom” TypeName=”CodePropertyReferenceExpression” Authorized=”True” />

And for SharePoint 2007 and 2010, use these lines:

<authorizedType Assembly=”System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″ NameSpace=”System.CodeDom” TypeName=”CodeBinaryOperatorExpression” Authorized=”True” />

<authorizedType Assembly=”System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″ NameSpace=”System.CodeDom” TypeName=”CodePrimitiveExpression” Authorized=”True” />

<authorizedType Assembly=”System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″ NameSpace=”System.CodeDom” TypeName=”CodeMethodInvokeExpression” Authorized=”True” />

<authorizedType Assembly=”System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″ NameSpace=”System.CodeDom” TypeName=”CodeMethodReferenceExpression” Authorized=”True” />

<authorizedType Assembly=”System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″ NameSpace=”System.CodeDom” TypeName=”CodeFieldReferenceExpression” Authorized=”True” />

<authorizedType Assembly=”System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″ NameSpace=”System.CodeDom” TypeName=”CodeThisReferenceExpression” Authorized=”True” />

<authorizedType Assembly=”System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″ NameSpace=”System.CodeDom” TypeName=”CodePropertyReferenceExpression” Authorized=”True” />

Solution

The solution is to add explicitly the types to all web applications’ web.config:

<authorizedType Assembly=”System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″ NameSpace=”System.CodeDom” TypeName=”CodeBinaryOperatorExpression” Authorized=”True” />

<authorizedType Assembly=”System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″ NameSpace=”System.CodeDom” TypeName=”CodePrimitiveExpression” Authorized=”True” />

<authorizedType Assembly=”System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″ NameSpace=”System.CodeDom” TypeName=”CodeMethodInvokeExpression” Authorized=”True” />

<authorizedType Assembly=”System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″ NameSpace=”System.CodeDom” TypeName=”CodeMethodReferenceExpression” Authorized=”True” />

<authorizedType Assembly=”System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″ NameSpace=”System.CodeDom” TypeName=”CodeFieldReferenceExpression” Authorized=”True” />

<authorizedType Assembly=”System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″ NameSpace=”System.CodeDom” TypeName=”CodeThisReferenceExpression” Authorized=”True” />

<authorizedType Assembly=”System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″ NameSpace=”System.CodeDom” TypeName=”CodePropertyReferenceExpression” Authorized=”True” />

Or (for SharePoint 2007 and 2010):

<authorizedType Assembly=”System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″ NameSpace=”System.CodeDom” TypeName=”CodeBinaryOperatorExpression” Authorized=”True” />

<authorizedType Assembly=”System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″ NameSpace=”System.CodeDom” TypeName=”CodePrimitiveExpression” Authorized=”True” />

<authorizedType Assembly=”System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″ NameSpace=”System.CodeDom” TypeName=”CodeMethodInvokeExpression” Authorized=”True” />

<authorizedType Assembly=”System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″ NameSpace=”System.CodeDom” TypeName=”CodeMethodReferenceExpression” Authorized=”True” />

<authorizedType Assembly=”System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″ NameSpace=”System.CodeDom” TypeName=”CodeFieldReferenceExpression” Authorized=”True” />

<authorizedType Assembly=”System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″ NameSpace=”System.CodeDom” TypeName=”CodeThisReferenceExpression” Authorized=”True” />

<authorizedType Assembly=”System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″ NameSpace=”System.CodeDom” TypeName=”CodePropertyReferenceExpression” Authorized=”True” />

Please notice that sometimes SharePoint Timer Service (SPTimerV4) runs workflows. If you notice that the application showing the error is ULS logs in OWSTIMER.EXE, you should also include the authorized types in [SharePoint Hive Folder]\bin\OWSTIMER.EXE.config. The Hive Folder will change by version of SharePoint. For SharePoint 2016, it is normally at c:\program files\common files\microsoft shared\web server extensions\16. For 2013, at c:\program files\common files\microsoft shared\web server extensions\15.

Additional Information

My colleague Joe Rodgers, who is Sr. PFE, put together this PowerShell script: https://gist.github.com/joerodgers/2302b394796c865818839d843bae2dad

There are two scripts. Normally, the only necessary script is:

Add-CodeDomAuthorizedType.ps1

Uncomment this line to make the changes:

Add-CodeDomAuthorizedType

If you have Nintex workflows you should run like this:

Add-CodeDomAuthorizedType -IncludeNintexWorkflow

To undo the changes, run:

Remove-CodeDomAuthorizedType

The script needs to run only once on any WFE. All web.config files related to SharePoint on all servers will be modified. New web applications created after that will also include the changes. Even if a new WFE is added to the farm, the entries will also be included in web.config. The change is a permanent requirement from now on since the WF patch. You do not need to undo the change before applying the SharePoint patch addressing it.

There is a second script to update OWSTIMER.exe.config. This one should only run if you see the symptoms in ULS logs with process OWSTIMER.EXE. Otherwise, you do not need to update. if you have the problem though, you need to rerun the script if a new machine is added to the farm. No line needs to be uncommented for this one. The script name is:

Add-CodeDomAuthorizedTypeToOWSTimerConfig.ps1

Note

Microsoft is aware of this issue and patches for SharePoint 2010, 2013 and 2016 are being worked as of 9/17/2018. I will update when we have an ETA. I had confirmation from the product team on 9/18/2018 that this information and solution on this post is in the line with the future patch and it is the recommended action plan until the patch is out. If anything change, I will update the post.

Note 2

Some people using third-party workflows (like Nintex) need to also include this:

<authorizedType Assembly=”System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″ NameSpace=”System.CodeDom” TypeName=”CodeTypeReferenceExpression” Authorized=”True” />

Using the script, you need to add to the line defining types (line 24):

CodeTypeReferenceExpression

Example:
$typeNames = @( CodeBinaryOperatorExpression, CodePrimitiveExpression, CodeMethodInvokeExpression, CodeMethodReferenceExpression, CodeFieldReferenceExpression,CodeThisReferenceExpression, CodePropertyReferenceExpression“, “CodeTypeReferenceExpression”)

Note 3

Joe updated his script to add a switch for Nintex workflows.

Call this way to include the extra type required by Nintex:

Add-CodeDomAuthorizedType -IncludeNintexWorkflow

(all credit to Rodney Viana for this information)

Fun with PowerApps part 3: my first PowerApp

This is part three in my fun with PowerApps series where I’ll go through my personal experience of creating a new PowerApp from scratch and go through step-by-step for each part of the process…

You can read all parts of this series below:

Part 1: setting up the default gateway
Part 2: creating a data connection

Carrying on from my last post – creating a data connection, we are now good to go and begin to build our first PowerApp!

Just like setting up the data connection, creating a PowerApp can be a really simple thing to do.

However, I’ve found either creating a PowerApp from the SharePoint list or library is really quick and easy, but it doesn’t necessarily give you the most flexibility when it comes to wanting to do it your own way…

Creating a PowerApp

You can create a PowerApp from a list or library literally from the push of a button! Its as simple as:

  • Create your list or library, add all the associated columns and data you wish to be displayed in your PowerApp
  • Press the ‘PowerApps’ button on the list menu, then press ‘Create an app’

  • You’ll then be prompted to create your app, start by giving it a name and press ‘Create

After a few moments your app will be created! It will open in the PowerApps web editor and you should see your list columns and data displaying in your shiny new PowerApp!


You can also take a look at the app in the preview to get a good look at how it operates and how the data is displayed…

Conclusion…

That’s it! Your all set…but if you’re like me you’ll have some questions. Like, what if I want a desktop app and not a mobile one?

Well for that you’ll need to build an app from scratch, I’ll be going over creating a new PowerApp in the next part of this series so hold on as i’ll be posted the next part very soon!