Skip to content

Instantly share code, notes, and snippets.

View danjpadgett's full-sized avatar

Dan Padgett danjpadgett

View GitHub Profile
# ===============================================
# Script to decline superseeded updates in WSUS.
# ===============================================
# It's recommended to run the script with the -SkipDecline switch to see how many superseded updates are in WSUS and to TAKE A BACKUP OF THE SUSDB before declining the updates.
# Parameters:
# $UpdateServer = Specify WSUS Server Name
# $UseSSL = Specify whether WSUS Server is configured to use SSL
# $Port = Specify WSUS Server Port
# $SkipDecline = Specify this to do a test run and get a summary of how many superseded updates we have
danjpadgett / NewStart.xml
Created June 11, 2018 10:01
<LayoutModificationTemplate xmlns:defaultlayout="" xmlns:start="" xmlns:taskbar="" Version="1" xmlns="">
<LayoutOptions StartTileGroupCellWidth="6" />
<defaultlayout:StartLayout GroupCellWidth="6">
<start:Group Name="Office">
<start:DesktopApplicationTile Size="2x2" Column="0" Row="0" DesktopApplicationID="Microsoft.Office.EXCEL.EXE.15" />
<start:DesktopApplicationTile Size="2x2" Column="2" Row="0" DesktopApplicationID="Microsoft.Office.ONENOTE.EXE.15" />
<start:DesktopApplicationTile Size="2x2" Column="4" Row="0" DesktopApplicationID="Microsoft.Office.OUTLOOK.EXE.15" />
<start:DesktopApplicationTile Size="2x2" Column="4" Row="2" DesktopApplicationID="Microsoft.Office.lync.exe.15" />
danjpadgett / PowerPrompt.ps1
Last active April 2, 2019 09:21
prompt for a/c power during in place upgrade.
##//Call this at the start of the TS. serviceui.exe -process:TsProgressUI.exe %windir%\System32\WindowsPowerShell\v1.0\powershell.exe -WindowStyle hidden -executionpolicy Bypass -file .\PowerCheck.ps1
##//DEMO -
if (Get-WmiObject -Query "Select BatteryStatus from Win32_Battery WHERE BatteryStatus=2") {break}
else {
$T1 = New-Object -ComObject "Microsoft.SMS.TsProgressUI"
danjpadgett / unattended.xml
Created April 25, 2018 16:24
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="oobeSystem">
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="" xmlns:xsi="">
$SecureString = ConvertTo-SecureString "xxxxxx" -AsPlainText -Force
Unlock-BitLocker -MountPoint "D:" -Password $SecureString
.\manage-bde.exe -protectors -enable d:
$secure = ConvertTo-SecureString "xxxxxx" -AsPlainText -Force
danjpadgett / getTPMVersionStatus.sql
Created April 12, 2018 10:00
SELECT distinct CS.Manufacturer0 as 'Manufacturer',
CS.Model0 AS 'Model', CS.Name0 as 'Name', TPM.SpecVersion0 as 'SpecVersion',
TPM.IsActivated_InitialValue0 as 'IsActivated_InitialValue',
TPM.IsEnabled_InitialValue0 as 'IsEnabled_InitialValue',
TPM.IsOwned_InitialValue0 as 'IsOwned_InitialValue',
OPSYS.Caption0 as 'OS',
OPSYS.CSDVersion0 as 'ServicePack',
GSBIOS.SerialNumber0 as 'Serial No.'
Checks WSUS App Pool
Script will check status of WSUS APP Pool and if 'stopped' will email. Setup script as scheduled task on WSUS instance.
Version: 1.0
Author: dpadgett
Creation Date: 07/02/17
Purpose/Change: Production
danjpadgett / Office Channel.sql
Last active April 20, 2018 13:49
Office Channel
SELECT sys.Name0 [Computer Name] ,
"Update Channel" =
When O365.CDNBaseUrl00 = '' Then 'Semi-Annual Channel'
When O365.CDNBaseUrl00 = '' Then 'Monthly Channel'
When O365.CDNBaseUrl00 = '' Then 'Semi-Annual Channel (Targeted)'
When O365.CDNBaseUrl00 = '' Then 'Monthly Channel (Targeted)'
danjpadgett / Customise-Win10.ps1
Last active March 28, 2018 16:16
Sets W10 1709 Options
Sets W10 1709 Options
.PARAMETER <Parameter_Name>