Loading

Exportera / Importera Boot-image drivrutiner till ny Boot-image

Återigen, ett mycket bra PowerShell-script som besparar massa tid.

Function Export-BootImageDrivers {
    PARAM (
        [String] $ImageId,
        [String] $ExportXml
    )
  
    $drivers = @{}
    (Get-CMBootImage -Id $ImageId).ReferencedDrivers | ForEach-Object {
        Write-Verbose "Found driver ID - $($_.Id)"
 
        $drivers.Add($_.Id, $_.SourcePath)
    }
 
    $drivers | Export-Clixml -Path $ExportXml
}
 
Function Import-BootImageDrivers {
    PARAM (
        [String] $ImageId,
        [String] $ExportXml
    )
 
    $BootImage = Get-CMBootImage -Id $ImageId
    $drivers = Import-Clixml -Path $ExportXml
    $drivers.GetEnumerator() | ForEach-Object {
        Write-Verbose "Adding driver ID - $($_.Name)"
        Set-CMDriver -Id $_.Name -AddBootImagePackage $BootImage -UpdateDistributionPointsforBootImagePackage $false -Force
    }
}

Exportera först drivrutinerna

Export-BootImageDrivers -ImageId “ABC00123” -ExportXml “D:\Script\PS\drivers.xml”

Uppgradera Boot-imagen

Sedan importera drivrutinerna

Import-BootImageDrivers -ImageId “ABC00345” -ExportXml “D:\Script\PS\drivers.xml”

Tack till Rikard Rönnkvist, källa: SnowLand

Kopiera drivrutiner från en boot-image till en annan

Lifesaver. Eller med andra ord, en grym tidsbesparare.

Function Copy-BootImageDrivers {
    PARAM (
        $from, $to
    )
 
    $boot = Get-CMBootImage -ID $to
 
    (Get-CMBootImage -Id $from).ReferencedDrivers | ForEach-Object {
        Write-Verbose "Copying $($_.Id) to $($to)"
        Set-CMDriver -Id $_.Id -AddBootImagePackage $boot -UpdateDistributionPointsforBootImagePackage $false
    }
 
}
 
#Example use
Copy-BootImageDrivers -from "ABC00123" -to "ABC00456"

Tack till Rikard Rönnkvist, källa SnowLand

Windows versioner

Operating system Version number
Windows 10 10.0*
Windows Server 2016 Technical Preview 10.0*
Windows 8.1 6.3*
Windows Server 2012 R2 6.3*
Windows 8 6.2
Windows Server 2012 6.2
Windows 7 6.1
Windows Server 2008 R2 6.1
Windows Server 2008 6.0
Windows Vista 6.0
Windows Server 2003 R2 5.2
Windows Server 2003 5.2
Windows XP 64-Bit Edition 5.2
Windows XP 5.1
Windows 2000 5.0

WMI Filter:

Namespace:
root\CIMv2

Windows 10
Query:
select * from Win32_OperatingSystem where Version like “10.0%” and ProductType=”1″

Windows 8x
Query:
select * from Win32_OperatingSystem where Version like “6.2%” or Version like “6.3%” and ProductType=”1″