Skip to content

Instantly share code, notes, and snippets.

View OSDeploy's full-sized avatar

David Segura - PowerShell MVP OSDeploy

View GitHub Profile
[cmi]
namespace=urn:schemas-microsoft-com:unattend
ClientServerSplit=true
AnswerFileFormat=1
professionalworkstationn=WYPNQ-8C467-V2W6J-TX4WX-WT2RQ
enterpriseneval=MNXKQ-WY2CT-JWBJ2-T68TQ-YBH2V
serverrdshCore=NJCF7-PW8QT-3324D-688JX-2YV66
serverstorageworkgroupeval=NXCTR-YXXWC-TK368-HGGTF-8YB99
onecoreupdateos=NFDPX-3MV8X-THC2X-QQ9QP-P9YY6
@OSDeploy
OSDeploy / OSBuild Windows 10 1809 x64 Multi.json
Last active April 8, 2019 16:30
Multi-Language OSBuild
{
"TaskType": "OSBuild",
"TaskName": "Windows 10 1809 x64 Multi",
"TaskVersion": "19.4.11.0",
"TaskGuid": "900f013b-2f08-4304-a9aa-eb065477e67b",
"CustomName": "",
"OSMFamily": "Client Enterprise x64 17763 en-US",
"OSMGuid": "18887e55-5125-42ab-aaad-7b897bbb504b",
"Name": "Windows 10 Enterprise x64 1809 17763.404",
"ImageName": "Windows 10 Enterprise",
@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 ""
@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 / 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 / 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 / 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 / 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 / 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 / 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',`