Oh, hey everyone!

Hey folks! This blog has gone a little stagnant for a while. I’ve been busy, and have not been able to dedicate many of the working day hours to upkeep here.

But I hope to change that going forward. Within the past two years I have started up a YoueTube channel for some of my many hobbies (woodworking, metalworking, leatherworking, and just about ever other maker-thing you can think of, and some you have not) here at The New Janky Workshop. So, check that out (and subscribe!) if you’re into that sort of thing!

With that personal endeavour, I’ve also REALLY gotten into video editing and publishing (because yes, I need MOAR hobbies). So, I am going to try to semi-regularly post to my new channel, for things Microsoft, SharePointy, and other M365 topics (and also Azure, PowerShell, and other goodness). So, if you’re interested in that stuff (which, by the sake of you being on this post at all, likely means that you are). Please check it out: The SharePoint Yankee (and also subscribe there too!).

It’s brand new (so new, in fact, I just posted a quick short video today on it as my first one…). So, follow along, leave comments there or here on how you like the videos, what you’d like to see, and more, and I’ll get cracking on it.

Cheers!

Slides from the North American Collaboration Summit 2019

As promised, here are my slides from the North American Collaboration Summit 2019 presentation from yesterday, “Using Azure Runbooks to Automate SharePoint Tasks”

Speaking at SharePoint Saturday San Juan

43049817_10156779677362164_6495283152024502272_o

I am pleased to announce I will be speaking at SharePoint Saturday San Juan on November 3rd.

Register today at http://www.spsevents.org/city/sanjuan/sanjuan2018

The Microsoft Office 365 and Cloud community invites you to the second 365 & SharePoint office on Saturday to be held in San Juan.

It is a totally free event in which you will find technical and development sessions focused on Microsoft Collaboration tools such as SharePoint, Office 365, Integration with Azure, Power Apps, Flow, Project, Planner, OneDrive, Delve, SharePoint Framework, Power BI, Dynamics CRM, Blockchain among others. We will have the company of MVPs and specialized technical leaders in each of the different types of talks.

I will be presenting Using Azure Runbooks and Microsoft Flow to Automate SharePoint Tasks

Session Abstract

Runbooks are a feature of Azure Automation that allow you to execute workflows from within Azure or remotely to automate processes. Microsoft Flow allows you to attach to certain activities in SharePoint and across other platforms, to perform a task when a certain condition is met. In this session, you will learn how to link SharePoint Online, Microsoft Flow, and Azure Runbooks in order to execute scripts automatically against your SharePoint tenant, or really, perform or automate any task.

Hope to see you there!

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 = "https://sharepoint.sharepont.sharepoint.com"
 
# 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
    }
}

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:

$PSPrivateMetadata.JobId.Guid

image

And the output:

image

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

image

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.

image

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

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

image

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

image

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

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.

param(
[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…
$SPFile.Versions.DeleteAll()

# Dispose of the web object
$Web.Dispose()

# Dispose of the site object
$Site.Dispose()

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 “http://mysharepoint.com/sites/foo/Documents/Document_1.docx”

Enjoy!