1. 程式人生 > >4.如何為NanoServer安裝更新(KB)(待驗證已經反饋到社區)

4.如何為NanoServer安裝更新(KB)(待驗證已經反饋到社區)

重新啟動 sof 機器 restart img 剪輯 rup operation for

給安裝NanoServer安裝累計更新有兩種方式

-如果您的NanoServer無法連接到外網,即使用手動下載安裝的方式。

-如果您的NanoServer可以鏈接到外網可以使用Windows Update WMI 提供程序進行安裝。

? ?

? ?

? ?

A.使用Windows Update WMI提供程序安裝累計更新(未必在所有情況下可用)

#掃描可用更新

$ci = New-CimInstance -Namespace root/Microsoft/Windows/WindowsUpdate -ClassName MSFT_WUOperationsSession

$result = $ci | Invoke-CimMethod -MethodName ScanForUpdates -Arguments @{SearchCriteria="IsInstalled=0";OnlineScan=$true}

$result.Updates

? ?

? ?

? ?

? ?

#安裝所有可用更新

$ci = New-CimInstance -Namespace root/Microsoft/Windows/WindowsUpdate -ClassName MSFT_WUOperationsSession

Invoke-CimMethod -InputObject $ci -MethodName ApplyApplicableUpdates

Restart-Computer; exit

? ?

? ?

#獲取安裝的更新列表

$ci = New-CimInstance -Namespace root/Microsoft/Windows/WindowsUpdate -ClassName MSFT_WUOperationsSession

$result = $ci | Invoke-CimMethod -MethodName ScanForUpdates -Arguments @{SearchCriteria="IsInstalled=1";OnlineScan=$true}

$result.Updates

B.使用離線方式手動下載安裝更新

1.更新的提取cab

mkdir C:\ServicingPackages_expanded

mkdir C:\ServicingPackages_expanded\KB3176936

mkdir C:\ServicingPackages_expanded\KB3192366

Expand C:\ServicingPackages\KB3176936.msu -F:* C:\ServicingPackages_expanded\KB3176936

Expand C:\ServicingPackages\KB3192366.msu -F:* C:\ServicingPackages_expanded\KB3192366

mkdir C:\ServicingPackages_cabs

copy C:\ServicingPackages_expanded\KB3176936\Windows10.0-KB3176936-x64.cab C:\ServicingPackages_cabs

copy C:\ServicingPackages_expanded\KB3192366\Windows10.0-KB3192366-x64.cab C:\ServicingPackages_cabs

? ?

技術分享

? ?

屏幕剪輯的捕獲時間: 2017/5/23 13:39

? ?

? ?

? ?

? ?

? ?

2.復制補丁包到Nanoserver

$s = New-PSSession -ComputerName (Read-Host "Enter Nano Server IP address") -Credential (Get-Credential)

Copy-Item -ToSession $s -Path C:\ServicingPackages_cabs -Destination C:\ServicingPackages_cabs -Recurse

Enter-PSSession $s

? ?

技術分享

? ?

屏幕剪輯的捕獲時間: 2017/5/23 13:39

? ?

? ?

? ?

? ?

3.安裝補丁包

# Apply the servicing stack update first and then restart

Add-WindowsPackage -Online -PackagePath C:\ServicingPackages_cabs\Windows10.0-KB3176936-x64.cab

Restart-Computer; exit

? ?

# After restarting, apply the cumulative update and then restart

Enter-PSSession -ComputerName (Read-Host "Enter Nano Server IP address") -Credential (Get-Credential)

Add-WindowsPackage -Online -PackagePath C:\ServicingPackages_cabs\Windows10.0-KB3192366-x64.cab

Restart-Computer; exit

? ?

技術分享

? ?

屏幕剪輯的捕獲時間: 2017/5/23 13:41

? ?

? ?

技術分享

? ?

屏幕剪輯的捕獲時間: 2017/5/23 13:48

? ?

? ?

可以看到提示已經安裝成功並且在線,同時提示不需要重新啟動

如法炮制,安裝另外一個KB3192366

? ?

技術分享

? ?

屏幕剪輯的捕獲時間: 2017/5/23 13:58

? ?

顯然,KB3192366需要重啟機器。

? ?

技術分享

? ?

屏幕剪輯的捕獲時間: 2017/5/23 14:05

? ?

需要說明的是,這裏的安裝時間可能使用的是+12協調世界時

? ?

? ?

4.如何為NanoServer安裝更新(KB)(待驗證\已經反饋到社區)