Skip to content

Instantly share code, notes, and snippets.

Disable Device Enrollment Program (DEP) notification on macOS Catalina.md

With full reinstall (recommended)

   a. Boot into recovery using command-R during reboot, wipe the harddrive using Disk Utility, and select reinstall macOS

   b. Initial installation will run for approximately 1 hour, and reboot once

   c. It will then show a remaining time of about 10-15 minutes

@ITProCorner
ITProCorner / ImportSearchSchema.ps1
Created March 27, 2020 05:48 — forked from chrisobriensp/ImportSearchSchema.ps1
PS + CSOM to import search schema XML (e.g. managed property definitions)..
. .\TopOfScript.ps1
# need some extra types bringing in for this script..
Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Search.dll"
# TODO: replace this path with yours..
$pathToSearchSchemaXmlFile = "C:\COB\Cloud\PS_CSOM\XML\COB_TenantSearchConfiguration.xml"
# we can work with search config at the tenancy or site collection level:
#$configScope = "SPSiteSubscription"
$configScope = "SPSite"
@ITProCorner
ITProCorner / IterateWebsAndListsEnableVersioning.ps1
Created March 27, 2020 05:47 — forked from chrisobriensp/IterateWebsAndListsEnableVersioning.ps1
PS + CSOM to iterate webs/lists and set a property..
. .\TopOfScript.ps1
$enableVersioning = $true
$rootWeb = $clientContext.Web
$childWebs = $rootWeb.Webs
$clientContext.Load($rootWeb)
$clientContext.Load($childWebs)
$clientContext.ExecuteQuery()
@ITProCorner
ITProCorner / IterateWebs.ps1
Created March 27, 2020 05:42 — forked from chrisobriensp/IterateWebs.ps1
PS + CSOM to iterate webs, starting from the ClientContext web..
. .\TopOfScript.ps1
$rootWeb = $clientContext.Web
$childWebs = $rootWeb.Webs
$clientContext.Load($rootWeb)
$clientContext.Load($childWebs)
$clientContext.ExecuteQuery()
function processWeb($web)
{
@ITProCorner
ITProCorner / AddChoiceToChoiceField.ps1
Created March 17, 2020 06:36 — forked from OlafD/AddChoiceToChoiceField.ps1
In SharePoint Online, add a new choice value to an existing choice field. The fieldname in the example is "MyChoiceField" with 3 very simple choices. A fourth choice is added by the script. A connection to the SharePoint site must be established.
$field = Get-PnPField -Identity "MyChoiceField"
$ctx = Get-PnPContext
$fieldChoice = [Microsoft.SharePoint.Client.ClientContext].GetMethod("CastTo").MakeGenericMethod([Microsoft.SharePoint.Client.FieldChoice]).Invoke($ctx, $field)
$ctx.Load($fieldChoice)
Invoke-PnPQuery
Param(
[Parameter(Mandatory=$true, position=0, ValueFromPipeLineByPropertyName=$true, HelpMessage="Specifies the Web. The type must be a valid URL or GUID")]
[String]$WebUrl
)
Set-Location $PSScriptRoot
Add-Type -Path ( ".\SharePoint Assemblies\Microsoft.SharePoint.Client.dll")
Add-Type -Path ( ".\SharePoint Assemblies\Microsoft.SharePoint.Client.Runtime.dll")
# help to use lamda expressions to query object properties
. .\Load-CSOMProperties.ps1
@ITProCorner
ITProCorner / Load-CSOMProperties.ps1
Created March 17, 2020 06:33 — forked from glapointe/Load-CSOMProperties.ps1
Utility PowerShell function that facilitates the loading of specific properties of a Microsoft.SharePoint.Client.ClientObject object or Microsoft.SharePoint.Client.ClientObjectCollection object.
<#
.Synopsis
Facilitates the loading of specific properties of a Microsoft.SharePoint.Client.ClientObject object or Microsoft.SharePoint.Client.ClientObjectCollection object.
.DESCRIPTION
Replicates what you would do with a lambda expression in C#.
For example, "ctx.Load(list, l => list.Title, l => list.Id)" becomes
"Load-CSOMProperties -object $list -propertyNames @('Title', 'Id')".
.EXAMPLE
Load-CSOMProperties -parentObject $web -collectionObject $web.Fields -propertyNames @("InternalName", "Id") -parentPropertyName "Fields" -executeQuery
$web.Fields | select InternalName, Id