Microsoft cloud engineer - SharePoint, Office 365, Azure, DotNet, Angular, JavaScript.
Microsoft cloud engineer - SharePoint, Office 365, Azure, DotNet, Angular, JavaScript.

Blog

Reboot SharePoint Farm

Quick code snippet to share with you guys for rebooting the full SharePoint farm.   Invoke remote restart command to all peer machines with any valid SharePoint role, then reboot local machine last.   NOTE – SQL not included but can be with adjusting the filter.  Cheers. 

shades_smile

Code

Add-PSSnapIn "Microsoft.SharePoint.PowerShell"
$local = $env:COMPUTERNAME
$localFQDN = $env:COMPUTERNAME + "." + $env:USERDNSDOMAIN
$targets = Get-SPServer |? {$_.Role -ne "Invalid"} |? {$_.Address -ne $local -and $_.Address -ne $localFQDN} | Select Address
$targets |% {Write-Host "Rebooting $($_)"; Restart-Computer $_ -Force}
Restart-Computer -Force

Download

SPRebootFarm.ps1

VIDEO – Protect WebAPI data endpoint with ADAL (Azure AD)

Wanted to record brief demo of how to protect WebAPI data endpoint with ADAL (Azure Active Directory) Authentication Library.   Azure Portal enables us to register custom SPA (Single Page Application) for secure API calls to backend REST data sources.   OAuth Bearer HTTP headers are applied to provide security with JWT tokens (JSON Web Token).   Video shows all steps from Azure Portal registration to F12 validation of REST data calls.

Cheers 

shades_smile

Video

Screenshots

image
image
image
image
image
image
image
image

Code


References

VIDEO – Deploy Azure VM using ARM template and Bash Cloud Shell

Wanted to record a live demo of how to use the Azure portal Cloud Shell to create Virtual Machines with Azure Resource Manager (ARM) templates.   JSON format stores the various resources we want and can be difficult to read in raw format.   Fortunately Microsoft offers ARMVIZ online utility to graphically display the contents of ARM JSON files, including dependency arrows, familiar colorized resource icons,  and feature to double click any item and view matching JSON line.

Cheers

shades_smile

Video

Screenshots

https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-vm-simple-windows/azuredeploy.json

image

https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-cosmosdb-sql/azuredeploy.json

image

https://github.com/Azure/azure-quickstart-templates/blob/master/oms-scomacs-solution/azuredeploy.json

image

https://github.com/Azure/azure-quickstart-templates/blob/master/oms-active-directory-security-audit-solution/azuredeploy.json

image

image

image

References

VIDEO – SPFx Application Customizer for Google Analytics tracking Modern SPO

Demo how to inject Google Analytics traffic tracking JavaScript to any Modern SharePoint Online site with SPFX .   Full coding demo shows steps for coding, configuration, deployment, and testing.   Modern page UI is tightly controlled by Microsoft to keep customers on the product roadmap.   Using SPFX to inject Application Customizer is the recommended and supported method to Also feel free to download the complete SPPKG package, upload to App Catalog, and deploy to any SPO site collection on your tenant.   Simply change the final PowerShell cmdlet (Add-PnPCustomAction) to have the correct Google Analytics Tracking ID for your GA Property. Cheers. 

shades_smile

Video

SPPKG Code

PNP Install

Connect-PnPOnline -UseWebLogin -Url https://spjeff.sharepoint.com
Get-PnPWeb
# Use GUID from SPFX MANIFEST.JSON
Add-PnPCustomAction -ClientSideComponentId "c430bd95-a1ac-4edd-9e25-7dbf3358062b" -Name "Google Analytics for SharePoint" -Title "GA for SharePoint" -Location ClientSideExtension.ApplicationCustomizer -ClientSideComponentProperties: '{"trackingID":"UA-5417707-7"}' -Scope Site
Get-PnPCustomAction -Scope Site

Screenshots

image
image
image
image
image
image
image

References

    © Copyright 2016
    @ SPJeff

    Return to Top ▲Return to Top ▲