This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[cmdletbinding()] | |
param ( | |
[Parameter(Mandatory=$true)] [string] $WhereClause, | |
[Parameter(Mandatory=$true)] [string] $ExportFilename, | |
[switch] $ForceExport | |
) | |
# Load ODBC utility functions | |
. $PSScriptRoot\odbc_utils.ps1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-CredsConnString() { | |
[OutputType([hashtable])] | |
[cmdletbinding()] | |
param ( | |
[Parameter(Mandatory=$true)][PSCredential] $Credential | |
) | |
$PlainCred = [ordered] @{ | |
UID = $Credential.UserName | |
PWD = [PSCredential]::new(0, $Credential.Password).GetNetworkCredential().Password | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[cmdletbinding()] | |
param ( | |
[Parameter(Mandatory)][System.IO.DirectoryInfo]$SourceFolder, | |
[Parameter(Mandatory)][string]$RemoteFolder, | |
[Parameter(Mandatory)][string]$Server, | |
[Parameter(Mandatory)][pscredential]$Credential | |
) | |
function New-TemporaryDirectory { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Send-CustomMail { | |
[cmdletbinding()] | |
param ( | |
[Parameter(Mandatory)][string[]]$To, | |
[Parameter(Mandatory)][string]$Subject, | |
[Parameter(Mandatory)][string]$Body, | |
[string]$SMTPServer = 'SMTP.ACME.LOCAL', | |
[string]$From = '[email protected]', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Test-ADUser() { | |
[CmdletBinding()] | |
<# | |
Perform a user account lookup on a given DC and return a boolean | |
indicating success or failure. | |
#> | |
param( | |
[string]$UserName, | |
[string]$Server | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Requires -Module ExchangeOnlineManagement | |
#Requires -Module BurntToast | |
$UPN = '[email protected]' | |
$DateFormatCulture = [CultureInfo]'en-GB' | |
# This has to be at the top, before the calendar, to avoid the 'single thread apartment' error | |
Write-Host 'Connecting to Exchange Online...' | |
Connect-ExchangeOnline -UserPrincipalName $UPN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Requires -Module BurntToast | |
[cmdletbinding()] | |
param ( | |
[Parameter(Mandatory)][string]$ComputerName, | |
[Parameter(Mandatory)][string]$ConnectionID | |
) | |
function Test-TCPPort { | |
# Replacement for Test-NetConnection, because ping cannot be disabled. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Requirements | |
# yattag==1.12.2 | |
# PyPDF2==1.26.0 | |
# Tested with Python 3.7.4 on macOS | |
import sys | |
from pathlib import Path |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "code", | |
"execution_count": 7, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ |
NewerOlder