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

November 2019

How to script SharePoint Prerequisite IIS Role

When creating a new SharePoint 2013/2016/2019 server, the IIS web role needs to be installed with certain features enabled.   Below is PowerShell one liner to accomplish that.  Cheers. 

shades_smile

Code

Add-WindowsFeature NET-HTTP-Activation,NET-Non-HTTP-Activ,NET-WCF-Pipe-Activation45,NET-WCF-HTTP-Activation45,Web-Server,Web-WebServer,Web-Common-Http,Web-Static-Content,Web-Default-Doc,Web-Dir-Browsing,Web-Http-Errors,Web-App-Dev,Web-Asp-Net,Web-Asp-Net45,Web-Net-Ext,Web-Net-Ext45,Web-ISAPI-Ext,Web-ISAPI-Filter,Web-Health,Web-Http-Logging,Web-Log-Libraries,Web-Request-Monitor,Web-Http-Tracing,Web-Security,Web-Basic-Auth,Web-Windows-Auth,Web-Filtering,Web-Digest-Auth,Web-Performance,Web-Stat-Compression,Web-Dyn-Compression,Web-Mgmt-Tools,Web-Mgmt-Console,Web-Mgmt-Compat,Web-Metabase,WAS,WAS-Process-Model,WAS-NET-Environment,WAS-Config-APIs,Web-Lgcy-Scripting,Windows-Identity-Foundation,Xps-Viewer -verbose

Screenshots

image

Delete ALL One-Time SPTimerJobs

One time SharePoint timer jobs can often get “stuck” and fail to execute.   Clearing them all out manually in Central Admin is tedious.  PowerShell below will remove all “One-time” jobs with a one liner. Cheers.  

shades_smile

PowerShell Code

Get-SPTimerJob |? {$_.Schedule.GetType().ToString() -eq "Microsoft.SharePoint.SPOneTimeSchedule"} | % {$_.Delete()}

Screenshot

image

References

VIDEO – PowerApps – Super Gallery

Working with Gallery control in PowerApps can be a limiting way to navigate records.   Many PowerApps include multiple screens with dedicated Gallery screens for navigation.   Helping users locate records (sort, filter, scroll, and search) would be better accomplished with SharePoint Views.   SharePoint List Views are more mature with full features for ad-hoc sort, filter, search and ability to save query (shared/personal) and provide hyperlinks to view ASPX pages.

Why not use SharePoint Views instead of Gallery control?

Turns out we can.   On SharePoint modern pages:

  1. Create new custom column with simple formula “=[ID]”
  2. Apply JSON custom formatting to generate link <A HREF=”…power app URL..ID=1”> which opens PowerApps, giving ID number for a single record to Edit
  3. Share View URL with end users to navigate records (sort/filter/search/paging)

This gives a robust and familiar navigation experience.  Use PowerApps for it’s strength (input validation) and use SharePoint list for it’s strength (navigate records).  Cheers. 

shades_smile

Video

PowerApps – Super Gallery from Jeff Jones on Vimeo.

Screenshots

image
image
image

References

Code – GitHub Repo

Code – SuperGallery-Modern-VIEW-FORM-column

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "div",
  "children": [
    {
      "elmType": "a",
      "style": {
        "color": "white",
        "display": "inline-block",
        "padding": "4px",
        "background-color": "purple"
      },
      "attributes": {
        "target": "_blank",
        "href": "='https://apps.powerapps.com/play/015ba39a-db14-4d5f-80a9-c23881784383?tenantId=19e61d8c-a318-488b-8d4e-33bc232b3530&source=portal&screenColor=rgba(0%2C%20176%2C%20240%2C%201)&ID=' + [$ID]"
      },
      "children": [
        {
          "elmType": "span",
          "txtContent": "VIEW FORM"
        }
      ]
    }
  ]
}

© Copyright 2016
@ SPJeff

Return to Top ▲Return to Top ▲