WSUSを構築してWindows 10の更新を管理する

以下の技術情報に分かりやすくまとめられています。
technet.microsoft.com

Windows Defenderの構成は忘れがちなので、Windows Defenderを無効にしていない場合は構成しましょう。
Windows 10 での Windows Defender の構成 (Windows)

この記事は?

Japan WSUS Support Team Blogを読み、必要な情報をまとめました。
blogs.technet.microsoft.com

誤ったまとめをしている可能性がありますので、必ず検証をしてから操作をしてください。

準備

WSUS 4.0が必要です。WSUS 4.0はWindows Server 2016, 2012 R2, 2012で利用可能です。

Windows Server 2012

必要に応じてadmxをコピーする Download Administrative Templates (.admx) for Windows 10 and Windows Server 2016 - 日本語 from Official Microsoft Download Center

Report Viewer: Download Microsoft Report Viewer 2008 SP1 Redistributable - 日本語 from Official Microsoft Download Center
KB3095113: https://support.microsoft.com/ja-jp/help/3095113/update-to-enable-wsus-support-for-windows-10-feature-upgrades
KB3159706: https://support.microsoft.com/ja-jp/help/3159706/update-enables-esd-decryption-provision-in-wsus-in-windows-server-2012-and-windows-server-2012-r2

SSLを使用しない場合
  • "C:\Program Files\Update Services\Tools\wsusutil.exe" postinstall /servicing
  • .NET Framework 4.5 Features の HTTP Activationを有効にする
SSLを使用する場合はKB3159706を参照してください

パフォーマンスの向上 (オプション)

設定

sqlcmd -E -S \\.\pipe\microsoft##wid\tsql\query
exec sp_configure 'show advanced options',1
go
reconfigure
go
exec sp_configure 'min server memory',1024
go
reconfigure
go

run_value の確認を忘れずに。

exec sp_configure 'min server memory' 
go
sqlcmd -S np:\\.\pipe\microsoft##wid\tsql\query –i WsusDBMaintenance.sql

gallery.technet.microsoft.com

WsusDBMaintenance.sql
/****************************************************************************** 
This sample T-SQL script performs basic maintenance tasks on SUSDB 
1. Identifies indexes that are fragmented and defragments them. For certain 
   tables, a fill-factor is set in order to improve insert performance. 
   Based on MSDN sample at http://msdn2.microsoft.com/en-us/library/ms188917.aspx 
   and tailored for SUSDB requirements 
2. Updates potentially out-of-date table statistics. 
******************************************************************************/ 
 
USE SUSDB; 
GO 
SET NOCOUNT ON; 
 
-- Rebuild or reorganize indexes based on their fragmentation levels 
DECLARE @work_to_do TABLE ( 
    objectid int 
    , indexid int 
    , pagedensity float 
    , fragmentation float 
    , numrows int 
) 
 
DECLARE @objectid int; 
DECLARE @indexid int; 
DECLARE @schemaname nvarchar(130);  
DECLARE @objectname nvarchar(130);  
DECLARE @indexname nvarchar(130);  
DECLARE @numrows int 
DECLARE @density float; 
DECLARE @fragmentation float; 
DECLARE @command nvarchar(4000);  
DECLARE @fillfactorset bit 
DECLARE @numpages int 
 
-- Select indexes that need to be defragmented based on the following 
-- * Page density is low 
-- * External fragmentation is high in relation to index size 
PRINT 'Estimating fragmentation: Begin. ' + convert(nvarchar, getdate(), 121)  
INSERT @work_to_do 
SELECT 
    f.object_id 
    , index_id 
    , avg_page_space_used_in_percent 
    , avg_fragmentation_in_percent 
    , record_count 
FROM  
    sys.dm_db_index_physical_stats (DB_ID(), NULLNULL , NULL'SAMPLED'AS f 
WHERE 
    (f.avg_page_space_used_in_percent < 85.0 and f.avg_page_space_used_in_percent/100.0 * page_count < page_count - 1) 
    or (f.page_count > 50 and f.avg_fragmentation_in_percent > 15.0) 
    or (f.page_count > 10 and f.avg_fragmentation_in_percent > 80.0) 
 
PRINT 'Number of indexes to rebuild: ' + cast(@@ROWCOUNT as nvarchar(20)) 
 
PRINT 'Estimating fragmentation: End. ' + convert(nvarchar, getdate(), 121) 
 
SELECT @numpages = sum(ps.used_page_count) 
FROM 
    @work_to_do AS fi 
    INNER JOIN sys.indexes AS i ON fi.objectid = i.object_id and fi.indexid = i.index_id 
    INNER JOIN sys.dm_db_partition_stats AS ps on i.object_id = ps.object_id and i.index_id = ps.index_id 
 
-- Declare the cursor for the list of indexes to be processed. 
DECLARE curIndexes CURSOR FOR SELECT * FROM @work_to_do 
 
-- Open the cursor. 
OPEN curIndexes 
 
-- Loop through the indexes 
WHILE (1=1BEGIN 
    FETCH NEXT FROM curIndexes 
    INTO @objectid, @indexid, @density, @fragmentation, @numrows; 
    IF @@FETCH_STATUS < 0 BREAK; 
 
    SELECT  
        @objectname = QUOTENAME(o.name) 
        , @schemaname = QUOTENAME(s.name) 
    FROM  
        sys.objects AS o 
        INNER JOIN sys.schemas as s ON s.schema_id = o.schema_id 
    WHERE  
        o.object_id = @objectid; 
 
    SELECT  
        @indexname = QUOTENAME(name) 
        , @fillfactorset = CASE fill_factor WHEN 0 THEN 0 ELSE 1 END 
    FROM  
        sys.indexes 
    WHERE 
        object_id = @objectid AND index_id = @indexid; 
 
    IF ((@density BETWEEN 75.0 AND 85.0AND @fillfactorset = 1OR (@fragmentation < 30.0) 
        SET @command = N'ALTER INDEX ' + @indexname + N' ON ' + @schemaname + N'.' + @objectname + N' REORGANIZE'; 
    ELSE IF @numrows >= 5000 AND @fillfactorset = 0 
        SET @command = N'ALTER INDEX ' + @indexname + N' ON ' + @schemaname + N'.' + @objectname + N' REBUILD WITH (FILLFACTOR = 90)'; 
    ELSE 
        SET @command = N'ALTER INDEX ' + @indexname + N' ON ' + @schemaname + N'.' + @objectname + N' REBUILD'; 
    PRINT convert(nvarchar, getdate(), 121) + N' Executing: ' + @command; 
    EXEC (@command); 
    PRINT convert(nvarchar, getdate(), 121) + N' Done.'END 
 
-- Close and deallocate the cursor. 
CLOSE curIndexes; 
DEALLOCATE curIndexes; 
 
 
IF EXISTS (SELECT * FROM @work_to_do) 
BEGIN 
    PRINT 'Estimated number of pages in fragmented indexes: ' + cast(@numpages as nvarchar(20)) 
    SELECT @numpages = @numpages - sum(ps.used_page_count) 
    FROM 
        @work_to_do AS fi 
        INNER JOIN sys.indexes AS i ON fi.objectid = i.object_id and fi.indexid = i.index_id 
        INNER JOIN sys.dm_db_partition_stats AS ps on i.object_id = ps.object_id and i.index_id = ps.index_id 
 
    PRINT 'Estimated number of pages freed: ' + cast(@numpages as nvarchar(20)) 
END 
GO 
 
 
--Update all statistics 
PRINT 'Updating all statistics.' + convert(nvarchar, getdate(), 121)  
EXEC sp_updatestats 
PRINT 'Done updating statistics.' + convert(nvarchar, getdate(), 121)  
GO

構成

役割を追加

  1. f:id:morokoshidog:20170225210254p:plain
  2. f:id:morokoshidog:20170225210256p:plain
  3. f:id:morokoshidog:20170225210257p:plain
  4. f:id:morokoshidog:20170225210259p:plain
  5. f:id:morokoshidog:20170225210302p:plain

初回

  1. f:id:morokoshidog:20170225210334p:plain
  2. f:id:morokoshidog:20170225210336p:plain
  3. f:id:morokoshidog:20170225210338p:plain
  4. f:id:morokoshidog:20170225210340p:plain
  5. f:id:morokoshidog:20170225210342p:plain
  6. f:id:morokoshidog:20170225210344p:plain
  7. f:id:morokoshidog:20170225210345p:plain
  8. 製品を選択します。ストレージ容量は余裕をもって設計しましょう。WSUS で選択する Windows 10 の製品分類について – Japan WSUS Support Team Blog f:id:morokoshidog:20170225210347p:plainf:id:morokoshidog:20170225210348p:plainf:id:morokoshidog:20170225210350p:plain
  9. 必要に応じて分類を選択します。ストレージ容量は余裕をもって設計しましょう。f:id:morokoshidog:20170225210351p:plain
  10. f:id:morokoshidog:20170225210353p:plain
  11. f:id:morokoshidog:20170225210354p:plain
  12. 承認するまではエクスクラメーションマークの警告メッセージが表示されます。 f:id:morokoshidog:20170225210355p:plain

高速インストールファイル

ストレージ容量は余裕をもって設計しましょう。

  1. オプションから設定変更します f:id:morokoshidog:20170225210623p:plainf:id:morokoshidog:20170225210626p:plain

自動承認

必要に応じて自動承認を構成しましょう

  1. 規則は作成・編集できます f:id:morokoshidog:20170225210646p:plain
  2. f:id:morokoshidog:20170225210734p:plain
  3. 前述の手順で初回同期をした場合は"規則の実行"を選択します f:id:morokoshidog:20170225210735p:plain

更新ビューを追加 (オプション)

  1. f:id:morokoshidog:20170225210900p:plain
  2. f:id:morokoshidog:20170225210902p:plain
  3. f:id:morokoshidog:20170225210904p:plain
  4. f:id:morokoshidog:20170225210905p:plain

更新ビューで表示される項目を追加する (オプション)

  1. "承認"や"状態"を選択してから"最新の状態に更新" f:id:morokoshidog:20170225210908p:plain
  2. "優先"や"リリース日"を追加してから"すべてのビューに適用" f:id:morokoshidog:20170225210911p:plain
  3. f:id:morokoshidog:20170225210914p:plain

運用中のメンテナンス

データベースのメンテナンス

blogs.technet.microsoft.com

クリーンアップ

  1. f:id:morokoshidog:20170225215241p:plain
  2. f:id:morokoshidog:20170225215243p:plain
  3. f:id:morokoshidog:20170225215245p:plain

不要な更新プログラムをできる限り「拒否済み」にする

拒否をする更新プログラムを1つずつ選ぶのは大変ですので、更新プログラムの運用をサポートするスクリプトで補助しましょう。

免責事項をご確認ください。

morokoshi.hateblo.jp