Disable Minimal Download Strategy Across All Sites and Site Collections via PowerShell

Minimal Download Strategy… the bane of pretty much everyone’s existence… well, at least in SharePoint. Especially if you’re using JavaScript (who would do that?!).  It’s useless. And while it was created for a good purpose, I have yet to come across a client that actually needed it over the pains it generally causes.

I recently had a client ask me to remove it from everything (hear that large cheering section in the stadium?)… so I threw together a script that will disable it from every site in a web application. Here she is!

# Load the SharePoint PowerShell Module… if not running this in the SharePoint Console…
Add-PSSnapin Microsoft.SharePoint.PowerShell –ErrorAction SilentlyContinue
# URL to our web application
$WebApp = ""
# Get all webs within a web application
$Webs = Get-SPWebApplication $WebApp | Get-SPSite -Limit All | Get-SPWeb -Limit All

# Loop through said webs
foreach ($Web in $Webs)
    # Is MDS enabled?
    $MDSEnabled = Get-SPFeature -web $Web.URL  | Where-object {$_.DisplayName -eq "MDSFeature"}
    # If it is… disable it!
    if ($MDSEnabled -ne $null)
        Disable-SPFeature –identity "MDSFeature" -URL $Web.URL -confirm:$false


Boston Area SharePoint Users Group March 13, 2018 Meeting

Join us from anywhere! For the first time we’re doing a Skype-only meeting. Read the below for more information, and go here to register! Skype details will be mailed out tomorrow to all registered attendees after registration closes at 5PM EST.

The Boston Area SharePoint Users Group (BASPUG) was founded to bring together like minds to network and share their experiences, triumphs, and tribulations around Microsoft SharePoint, to provide a community platform for Boston area SharePoint users, administrators, developers, architects, of all experience levels, even brand new to SharePoint, to share their knowledge with the community.


Andrew Connell will be presenting "Building Client Web Parts with the SharePoint Framework"
Session Abstract

​The new SharePoint Framework allows development of client side web parts that work on both modern and classic SharePoint pages. In this session you’ll learn how to put the Framework to work building and deploying these web parts. You’ll learn how to develop web parts that are editable from the SharePoint page, and that are responsive and look like part of the overall SharePoint experience. Don’t miss this opportunity to hit the ground running with this new SharePoint development model.

About the Speaker

Andrew Connell is a full stack web developer with a focus on Microsoft Azure & Office 365, specifically the Office 365 APIs, SharePoint, Microsoft’s .NET Framework / .NET Core, Angular, Node.js and Docker that enjoys development, writing & teaching… if it’s cutting edge web you will find Andrew there! He has received Microsoft’s MVP award every year since 2005 and has helped thousands of developers through the various courses he’s authored and taught both in-person & in online courses. Recently he launched his own on-demand video platform, Voitanos ( to deliver his on-demand video training.

Throughout the years Andrew has been fortunate enough to share what he has learned at conferences like Microsoft’s TechEd, Build, Ignite & SharePoint conferences, Angular’s ngConf & AngularU, SPTechCon, SP Live 360, and Techorama among many others all around the world in North America, Europe, Asia & Australia. You can find Andrew on his popular blog (, follow him on Twitter @andrewconnell, check out some of the numerous projects he’s involved in on GitHub ( or listen to his popular weekly podcast, The Microsoft Cloud Show (, which is focused on Microsoft cloud services such as Azure and Office 365 as well as the competitive cloud landscape.​


​For the first time, we’ll be doing a completely remote meeting over Skype! Skype meeting details will sent out after registration has closed on the day of the meeting, around 5PM on March 13, 2018. So, please register in advance to make sure you receive the details!

Join our group on LinkedIn today to connect with the rest of the BASPUG members, and spread the word!

We are also on facebook!!/pages/Boston-Area-SharePoint-User-Group/113652405354617

Follow news about the Boston Area SharePoint Users Group on twitter by following us @BASPUG, and by using the hashtag #BASPUG

Visit the Boston Area SharePoint Users Group website at

Event meetings are organized by Geoff Varosky of BlueMetal and James Restivo of Crow Canyon Systems.

Please visit The Boston SharePoint Area Users Group page for more event details!

Have questions about Boston Area SharePoint Users Group March 13, 2018 Meeting? Contact Boston Area SharePoint Users Group

Getting the Job ID of an Executing Azure Runbook

If you’re calling an Azure runbook, it is sometimes useful to be able to get the Job ID, say, to report back and update the source that initiated the call to a runbook. This is a quick post on how to access that ID in PowerShell.

You can access it via the following:



And the output:


Getting the Plain Text Value of an Azure Key Vault Secret with PowerShell

Related imageAzure’s Key Vault is a great way to store certificates, usernames, passwords, for use in your Azure applications, infrastructure operations, and more.

This is just a quick post to tell you how you can get at the value of a stored Secret in the Key Vault with PowerShell and the Azure module.

You can see, I have a Key Vault named gvkeyvault, and a secret named geoffv


Now, to get it, we can use the Get-AzureKeyVaultSecret cmdlet. By giving it our VaultName and our key Name, we can see the key. However, that does not get us the value of our Secret.


To do that, we need to get the SecretValueText property of the Key Vault Secret.

(Get-AzureKeyVaultSecret –VaultName “gvkeyvault” –Name “geoffv”).SecretValueText


You can see we get the value out of “12345”…


Now I need to go change the combination of my luggage.

Slides from February 13, 2018 BASPUG Meeting

Thank you all who came out last night to see my presentation at the Boston Area SharePoint Users Group last night!

As promised, here are my slides from the presentation, hosted on SlideShare:

And here is a link to the blog post which contains all of the steps we demoed during the presentation:

Delete All Versions of a SharePoint File Using PowerShell

There may be instances where you need to remove all previous versions of a file. Well, this is the PowerShell script to do it. This will only work for SharePoint on-premises however.

[string] $UrlToFile

$Site = New-Object -Type Microsoft.SharePoint.SPSite -ArgumentList $UrlToFile
$Web = $Site.OpenWeb()
$SPFile = $Web.GetFile($UrlToFile)

Write-Host “Deleting all versions for file $($UrlToFile)…”

# Remove all versions for file…

# Dispose of the web object

# Dispose of the site object

Save this off as something rememberable, such as Remove-FileVersions.ps1, and pass it the full URL to the file you wish to remove all versions from, for example:

.\Remove-FileVersions.ps1 “”


Loading this assembly would produce a different grant set from other instances

I was trying to get to the root of an issue for a client’s environment that was mysteriously down (SharePoint 2013, March 2017 CU). IIS was up and running, disk space was fine, SQL was also fine, but the sites were just loading blank pages. I checked the error logs, on both the application servers, as well as the web front ends, and they all had this same error message. "An exception occurred when trying to issue security token: Loading this assembly would produce a different grant set from other instances". This is a new one on me, I’ve not seen this error before. (Surprise, it’s SharePoint!)


After a bit of searching, I found this article on TechNet, which advised in setting the trust level to full for the web.config files, clearing out ASP.NET temporary files, and a few other things. None of these solutions worked. However, in the comments of the same article, someone had noted to setting the following registry setting, adding a DWORD (32-bit) value of 1 under a new key named LoaderOptimization in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework. And also doing the same under HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework.

Rebooted the servers, although I am sure an IIS reset, and a manual restart of all of the services would have done the trick, but the Farm was down, so a reboot wasn’t an issue to perform.

I found more information on the issue from CA, on this page, under the heading "Defect DE46408 (Formerly 369408) – Application Errors When Instrumenting SharePoint", it states:

"This situation usually happens when the SharePoint site web.config is set to use the legacy CAS model. The legacy CAS model was introduced in .NET version 4, and provokes the error. Refer to for a reference of CAS changes in ASP.NET 4."

I am not exactly sure what prompted this issue, except that there were some recent security updates applied, but this did the trick. I’ll have to dig into this deeper as time permits and see if I can determine the root cause.

%d bloggers like this: