Skip to content

Instantly share code, notes, and snippets.


Daniel Streefkerk dstreefkerk

View GitHub Profile
randomvariable / dns_client_log.ps1
Last active Mar 21, 2019
DNS Client Logging on Windows
View dns_client_log.ps1
function Start-DNSClientLog {
$DnsOpLog = Get-WinEvent -ListLog Microsoft-Windows-DNS-Client/Operational
$DnsOpLog.IsEnabled = $true
function Get-DNSClientQueries {
foreach($event in (get-winevent Microsoft-Windows-DNS-Client/Operational | % { [xml]$_.ToXml() })) {
$Query = ($event.Event.EventData.Data | Where-Object { $_.Name -eq "QueryName" }).'#text'
leeramsay / PSADT-Cheatsheet.ps1
Last active Nov 26, 2020
PSADT snippits/cheatsheet
View PSADT-Cheatsheet.ps1
## Commonly used PSADT env variables
$envCommonDesktop # C:\Users\Public\Desktop
$envCommonPrograms # C:\ProgramData\Microsoft\Windows\Start Menu\Programs
$envProgramFiles # C:\Program Files
$envProgramFilesX86 # C:\Program Files (x86)
$envProgramData # c:\ProgramData
$envUserDesktop # c:\Users\{user currently logged in}\Desktop
$envUserStartMenuPrograms # c:\Users\{user currently logged in}\AppData\Roaming\Microsoft\Windows\Start Menu\Programs
$envSystemDrive # c:
$envWinDir # c:\windows
dampee / umbraco db cleanup.sql
Last active Jul 8, 2020
Umbraco Database cleanup. After pulling in an umbraco database from production, you don't need all history or log.
View umbraco db cleanup.sql
-- Umbraco Clear Old Document Versions To Decrease Database Size And Improve Performance
DECLARE @createdDate Datetime = DATEADD(m, -1, getdate())
-- dump logs
-- TRUNCATE TABLE umbracolog -- faster if log table is very big and you don't need anything
DELETE FROM umbracolog WHERE Datestamp < @createdDate
-- clean up old versions
bklockwood / offlinewucheck.ps1
Last active May 5, 2020
Powershell offline WU check
View offlinewucheck.ps1
This script performs the 'search' phase of a Windows Update, using the standard WUA API.
It does not download or install updates.
Sole purpose of this script is to find out how long it takes to download the required cabfile,
then process it against a live system and return the list of updates available for that system.
function DownloadFile {
param (
[Parameter(Mandatory=$true,Position=0)] $url,
[Parameter(Mandatory=$true,Position=1)] $file
You can’t perform that action at this time.