Skip to content

Instantly share code, notes, and snippets.

View OSDeploy's full-sized avatar

David Segura - PowerShell MVP OSDeploy

View GitHub Profile
@OSDeploy
OSDeploy / Catalog Component 2019-01 Intel MicroCode Windows Server 2016 1607 x64 KB4091664.xml
Created January 18, 2019 05:35
Save as C:\OSBuilder\Content\Updates\Component\Catalog Component 2019-01 Intel MicroCode Windows Server 2016 1607 x64 KB4091664.xml
<Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04">
<Obj RefId="0">
<TN RefId="0">
<T>System.Management.Automation.PSCustomObject</T>
<T>System.Object</T>
</TN>
<MS>
<S N="Category">Component</S>
<S N="KBNumber">4091664</S>
<S N="KBTitle">2019-01 Intel MicroCode Windows Server 2016 1607 x64 KB4091664</S>
@OSDeploy
OSDeploy / User Desktop Icons.xml
Created January 30, 2019 04:30
Registry XML User Desktop Icons.xml
<Collection clsid="{53B533F5-224C-47e3-B01B-CA3B3F3FF4BF}" name="User Desktop Icons" status="Values generated by the Registry Wizard" changed="2018-08-14 18:53:29" uid="{E520FCA4-5860-42DE-A187-E1EAE82C71B0}"><Registry clsid="{9CD4B2F4-923D-47f5-A062-E897DD1DAD50}" name="{018D5C66-4533-4307-9B53-224DE2ED1FE6}" descr="Wizard Generated Registry Item" image="12"><Properties action="U" hive="HKEY_CURRENT_USER" key="Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" name="{018D5C66-4533-4307-9B53-224DE2ED1FE6}" default="0" type="REG_DWORD" displayDecimal="0" value="00000001"/></Registry>
<Registry clsid="{9CD4B2F4-923D-47f5-A062-E897DD1DAD50}" name="{20D04FE0-3AEA-1069-A2D8-08002B30309D}" descr="Wizard Generated Registry Item" image="12"><Properties action="U" hive="HKEY_CURRENT_USER" key="Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" name="{20D04FE0-3AEA-1069-A2D8-08002B30309D}" default="0" type="REG_DWORD" displayDecimal="0" value="00000000"/>
@OSDeploy
OSDeploy / Export-CertificatesReg.ps1
Last active January 19, 2023 20:27
19.2.13 Export Certificates as REG files
$Certs = Get-ChildItem -Path Cert:\LocalMachine -Recurse | `
Where-Object {$_.PSIsContainer -eq $false} | `
Select-Object -Property FriendlyName, Thumbprint, Issuer, Subject, Handle, PSPath | `
Sort-Object FriendlyName | `
Out-GridView -PassThru
foreach ($Cert in $Certs) {
$Reg = @()
$Reg = Get-ChildItem -Path ('HKLM:\SOFTWARE\Microsoft\SystemCertificates',`
'HKLM:\SOFTWARE\Policies\Microsoft\SystemCertificates',`
@OSDeploy
OSDeploy / StartLayout.xml
Created February 14, 2019 20:55
StartLayout.xml used in OSBuilder as my Layout Modification
<?xml version="1.0" encoding="utf-8"?>
<LayoutModificationTemplate
xmlns="http://schemas.microsoft.com/Start/2014/LayoutModification"
xmlns:defaultlayout="http://schemas.microsoft.com/Start/2014/FullDefaultLayout"
xmlns:start="http://schemas.microsoft.com/Start/2014/StartLayout"
xmlns:taskbar="http://schemas.microsoft.com/Start/2014/TaskbarLayout"
Version="1">
<LayoutOptions StartTileGroupCellWidth="6" />
<DefaultLayoutOverride>
<StartLayoutCollection>
@OSDeploy
OSDeploy / Update-MSOffice2016Xml.ps1
Created February 15, 2019 16:02
Generates the Office 2016 XML used in Update-MSOffice2016.ps1 (Requires PoshWsus)
Import-Module -Name PoshWsus -Force
Connect-PSWSUSServer -WSUSserver 'wsus2019' -Port 8530
$Categories = Get-PSWSUSCategory | Where-Object {$_.Title -match 'Office 2016'}
$Office2016 = Get-PSWSUSUpdate -Category $Categories | Select-Object -Property *
$Office2016 = $Office2016 | Where-Object {$_.IsSuperseded -eq $false}
$Office2016 = $Office2016 | Where-Object {$_.IsLatestRevision -eq $true}
$Office2016 = $Office2016 | Where-Object {$_.Title -notlike "*farm-deployment*"}
$Office2016 | Export-Clixml -Path "C:\Users\Administrator\Desktop\Office\RawOffice2016.xml"
$UpdateProperties = @()
@OSDeploy
OSDeploy / OSDUpdateOffline.ps1
Created February 20, 2019 21:45
OSDUpdateOffline.ps1 BETA
function Get-MSPFileInfo {
param
(
[Parameter(Mandatory = $true)][IO.FileInfo]$Path,
[Parameter(Mandatory = $true)][ValidateSet('Classification', 'Description', 'DisplayName', 'KBArticle Number', 'ManufacturerName', 'ReleaseVersion', 'TargetProductName', 'Release', 'MoreInfoURL', 'OptimizedInstallMode', 'CreationTimeUTC', 'AllowRemoval', 'OptimizeCA', 'BuildNumber', 'StdPackageName', 'PatchType', 'IsMinorUpgrade')][string]$Property
)
try {
#Creating windows installer object
$WindowsInstaller = New-Object -ComObject WindowsInstaller.Installer
@OSDeploy
OSDeploy / OfficeUpdate.ps1
Created February 22, 2019 07:46
Office Update Test Script Thanks Sune
$Updates = Get-ChildItem "C:\Users\OSDUpdate\Desktop\Office 2016 64-Bit\updates" -Recurse -File -Include *.msp | Select-Object -Property *
$Updates = $Updates | Sort-Object -Property LastWriteTime
Measure-Command -Expression {
Write-Host "`n"
Write-Host "=====================================================================================" -ForegroundColor DarkGray
Write-Host "Installing Microsoft Office 2016 updates"
Write-Host "=====================================================================================" -ForegroundColor DarkGray
ForEach ($Update in $Updates) {
@OSDeploy
OSDeploy / 19.3.12.txt
Last active March 12, 2019 18:11
19.3.12 OSDUpdate
Catalog KBNumber Title
------- -------- -----
Office 2010 32-Bit 4462226 Security Update for Microsoft Office 2010 (KB4462226) 32-Bit Edition
Office 2010 64-Bit 4462226 Security Update for Microsoft Office 2010 (KB4462226) 64-Bit Edition
Windows 7 4474419 2019-03 Security Update for Windows 7 for x64-based Systems (KB4474419)
Windows 7 4474419 2019-03 Security Update for Windows 7 for x86-based Systems (KB4474419)
Windows 7 4489873 2019-03 Cumulative Security Update for Internet Explorer 11 for Windows 7 for x64-based systems (KB4489873)
Windows 7 4489873 2019-03 Cumulative Security Update for Internet Explorer 11 for Windows 7 for x86-based systems (KB4489873)
Windows 7 4489878 2019-03 Security Monthly Quality Rollup for Windows 7 for x64-based Systems (KB4489878)
Windows 7 4490628 2019-03 Servicing Stack Update for Windows 7 for x64-based Systems (KB449062
@OSDeploy
OSDeploy / SessionsLCU.ps1
Last active March 20, 2019 03:55
Returns LCU Installations in your OS
[xml]$SessionsXml = Get-Content -Path "$env:WinDir\Servicing\Sessions\Sessions.xml"
$Sessions = $SessionsXml.Sessions.Session | `
Where-Object {$_.Tasks.Phase.package.id -like "*RollupFix*" -and $_.Tasks.Phase.package.targetState -eq 'Installed'}
$InstalledLCU = @()
foreach ($Session in $Sessions) {
$obj = $null
$obj = New-Object System.Object
$obj | Add-Member -type NoteProperty -Name Complete -Value $Session.Complete
$obj | Add-Member -type NoteProperty -Name Package -Value $Session.Tasks.Phase.Package.id
@OSDeploy
OSDeploy / ApplyUpdates.ps1
Created March 20, 2019 20:25
BETA OSDUpdate Install Script
<#
.NOTES
AUTHOR: David Segura
#>
Start-Transcript
#======================================================================================
# Start Script
#======================================================================================
Write-Host "$PSCommandPath" -ForegroundColor Green
Write-Host ""