wsus
83 TopicsPowerShell ile WSUS kurulum ve yapılandırması (tr-TR)
Bu yazımda sizlere WSUS (Windows Server Update Services) bahsedeceğim. WSUS ile kendi yapınızda Windows serverlar için kendi update sunucunuzu yapılandırabilir ve bu sunucu üzerinden Microsoft ürünü kullandığınız işletim sistemlerini ve Microsoft yazılımlarını güncelleyebilirsiniz. PowerShell ile kurulum ve yapilandırmasını yapacağımız WSUS için detayları aşağıda bulabilirsiniz. Öncesinde bazı detaylardan bağsetmek isterim. WSUS normal şartlarda kolay kurulan ve yönetilen bir servistir ancak çok ilgi ister. Her gün kontrol edilmeli yada anlık olarak monitor edilmelidir. Günlük yayınlanan defender güncelllemeleri onaylanmalı yada otomatik olarak kurallaştırılarak onaylanması sağlanmalıdır. Aylık yayınlanan major ve minor Windows updateleri için incelemeler yapılmalı ve kontrollü bir şekilde uygulanmalıdır. Kurulum yapacağınız Windows Server domain join durumda yada workgroup olarak çalışan bir sunucu olabilir. Önerilen mimarilerde genelde Domain yapısında olması yönetim kolaylığı açısından tervcih edilemektedir. Ancak Workgroup olarakda sorunsuz çalışmaktadır. Kurulum için Windows Server işletim sistemimizde PowerShell'i administrator olarak çalıştırarak başlıyoruz. Install-WindowsFeature kurulum komutu ile iligli servisimiz WSUS için isim tanımlası ve yönetim araçlarını yüklemek için gerekli tanımlamaları aşağıdaki şekilde komutuma yazarak işlemlerime başlıyorum. Install-WindowsFeature UpdateServices -IncludeManagementTools Komut çıktısı: Windows PowerShell Copyright (C) Microsoft Corporation. All rights reserved. PS C:\Users\Administrator> Install-WindowsFeature UpdateServices -IncludeManagementTools Success Restart Needed Exit Code Feature Result ------- -------------- --------- -------------- True No Success {ASP.NET 4.7, HTTP Activation, Remote Serv... WARNING: Additional configuration may be required. Review the article Managing WSUS Using PowerShell at TechNet Library (http://go.microsoft.com/fwlink/?LinkId=235499) for more information on the recommended steps to perform WSUS installation using PowerShell. Kurulum işlemimiz tamamlanmıştır. Yapılandırma işlemleri için aşağıdaki PowerShell scripti size yardımcı olacaktır. ### WUSUS post-deplpyment yapilandirma ayarlari . "C:\Program Files\Update Services\Tools\WsusUtil.exe" postinstall CONTENT_DIR=C:\WSUS ### WSUS nesnesinin tanımlanması $wsus = Get-WSUSServer ### WSUS yapilandirma tanimlamasi $wsusConfig = $wsus.GetConfiguration() ### Microsoft güncellemelerinin yapilandirilamsi Set-WsusServerSynchronization –SyncFromMU ### Güncelleme paketi dil tanımlaması sadece ingilizce yapilandirilmisiti bu bölümde istediğiniz dilleri virgul ekleyerek kısa kodunu yazabilirsiniz. $wsusConfig.AllUpdateLanguagesEnabled = $false $wsusConfig.SetEnabledUpdateLanguages("en") $wsusConfig.Save() ### WSUS ve Microsoft güncelleme SYNC tanimlamasi $wsus.GetSubscription().StartSynchronizationForCategoryOnly() start-sleep 15 ### SYNC tanimlamasi while ($wsus.GetSubscription().GetSynchronizationStatus() -ne "NotProcessing") { $time = get-date -UFormat "%H:%M:%S" $total = $wsus.GetSubscription().getsynchronizationprogress().totalitems $processed = $wsus.GetSubscription().getsynchronizationprogress().processeditems $process = $processed/$total $progress = "{0:P0}" -f $process Write-Host "" Write-Host "The first synchronization isn't completed yet $time" Write-Host "Kindly have patience, the progress is $progress" Start-Sleep 10 } Write-Host "The synchronization has completed at $time" -ForegroundColor Green Write-Host "The WSUS Configuration will now continue" -ForegroundColor Green ### Guncelleme urunlerinin tanimlanmasi, bu bolumu genisletebilrisiniz. Ben örnek için sadece Windows Server 2019 ekledim scritpti genisleterek diger urunleride ekleyebilirsiniz. write-host 'Setting WSUS Products' Get-WsusProduct | where-Object { $_.Product.Title -in ( 'Windows Server 2019') } | Set-WsusProduct ### Guncelleme sinfilarinin tanimlanmasi yine bu bolumde de siniflari arttirabilir yada azaltabilirsiniz. write-host 'Setting WSUS Classifications' Get-WsusClassification | Where-Object { $_.Classification.Title -in ( 'Critical Updates', 'Definition Updates', 'Feature Packs', 'Security Updates', 'Service Packs', 'Update Rollups', 'Updates') } | Set-WsusClassification ### SYNC yapilandirmasi write-host 'Enabling WSUS Automatic Synchronisation' $subscription = $wsus.GetSubscription() $subscription.SynchronizeAutomatically=$true ### otomatik sync yapilandirmasi $subscription.SynchronizeAutomaticallyTimeOfDay= (New-TimeSpan -Hours 0) $subscription.NumberOfSynchronizationsPerDay=1 $subscription.Save() ### Guncellenecek hedef grubun belirlenmesi $wsus.CreateComputerTargetGroup("Updates") ### Guncelleme paketlerinin onaylanmasi write-host 'Configuring default automatic approval rule' [void][reflection.assembly]::LoadWithPartialName("Microsoft.UpdateServices.Administration") $rule = $wsus.GetInstallApprovalRules() | Where { $_.Name -eq "Default Automatic Approval Rule"} $class = $wsus.GetUpdateClassifications() | ? {$_.Title -In ( 'Critical Updates', 'Security Updates')} $class_coll = New-Object Microsoft.UpdateServices.Administration.UpdateClassificationCollection $class_coll.AddRange($class) $rule.SetUpdateClassifications($class_coll) $rule.Enabled = $True $rule.Save() ### Computer groupların güncelleme islemi $wsusConfig.OobeInitialized = $true $wsusConfig.Save() ### SYNC baslamasi $wsus.GetSubscription().StartSynchronization() Uygulama ekran görüntüleri: Windows Server Update Services açarsanız Overview ekranından yaptığımız işlemleri çapraz kontrolünü yapabilirsiniz. WSUS ile client ve server istemcilerinizi update etmek için; İstemcileri (Windows server işlerim sistemleri ve client işletim sistemlerini) WSUS'a ekleyerek güncellemelerini tek bir sunucu üzerinden kontrol ederek hangi sunucuda hangi güncelleme eksik yada hangi sunucunun güncellemeleri tamamlanmış görebiliyoruz. İstemci sistemi WSUS üzerinden güncellemek için aşağıdaki adımları yapmanız gerekmektedir. Bu işlemleri AD DS üzerinden policy olarak oluşturup tüm DC yapınızdaki bilgisayarları gruplayıp güncelleme servisini güncelleyebilirsiniz. Windows Update servisini WSUS üzerinde yapilandirmak için aşağıdaki işlemler iuygulayabilirsiniz. İlk olarak GPEDIT.msc (Local Group Policy Editor) gidiyoruz. Bu adımda WSUS sunucusuna istemciyi eklememiz için GPleri kullanıyoruz. Windows update server olarak WSUS'u göstereceğiz. Local Group Policy Editorumuz açıldığında aşağıdaki pencereyi görüntüleyeceksiniz. Local Computer Policy > Computer Configuration > Administrative Templates > Windows Components > Winows Update dizinine gidiyoruz. Windows Update Dizininde "Specify intranet Microsoft update service locaition" politikasını buluyoruz. Specify intranet Microsoft update service locaition çift tıklayara giriş yapıyoruz. Gördüğünüz gibi not configured şeklinde gözükmektedir. Bu politikayı aktif duruma getirmek için enabled konumuna getiriyoruz. Enabled ettikten sonra alt bölümde "set the intranet update service for detecting updates" ve "set the intranet statistics server" bölümlerine Vargonen olarak kullandığımız WSUS serverin bilgilerini giriyorsunuz. WSUS bilgisi: ht target=_blank target=_blank target=_blank target=_blanktp://192.168.2.212:8530 (işlem sürecinde wsus adresini FQDN olarak tanımlayıp gerekli dns yapılandırmasını yapıp kullanmanızı tavsiye ederim yarın IP adresini değiştirmek zorunda kalırsanız FQDN adresinin IP bilgisini değiştirmeniz yeterli olacaktır. .) Politikamızı aktif ettikten sonra aktif olduğunu kontrol etmek için Control Panel > Windows Update dizinine gidiniz. You receive updates: Managed by your system administrator şeklinde bir bölüm göreceksiniz. Bu WSUS üzerinden güncelleme aldığını gösteren bir uyardır. Özel durumlarda (Örneğin: WSUS çalışmadığında) "Check online for updates from Microsoft Update" linkine tıklayınız, güncellemeleriniz Microsoft update servisleri üzerinden online olarak indirilecektir. Güncellemeleri yüklemek ve kontrol etmek için check for updates linkine tıklayınız Çapraz kontrol için WSUS sunucusu üzerinden kontrol ediniz WSUS erişim bilgileriniz yok ise ilgili sistem yöneticinize başvurunuz. Sunucumuz başarı ile WSUS üzerine eklenmiş ve güncellemeleri tamamlanmış olduğunu göreceksiniz. Sunucunuz WSUS üzerinde gözükmüyor yada güncellemeleri yaptınız ve güncellemeler yüklü gözükmüyor ise aşağıdaki komutları çalıştırınız. Not: Komutlar komut satırı yada powershell de çalışmaktadır herhangi birinde bu işlemi gerçekleştirebilirsiniz. wuauclt.exe /resetauthorization /detectnow komutunu çalıştırıyoruz. wuauclt.exe /resetauthorization /detectnow İşle sonucu ekrana çıktı vermeyecektir. 5 dk sonra WSUS üzerinden tekrar kontrol ediniz. Kaynak: docs.microsoft.com Kaynak: spiceworks.com1.3KViews5likes0CommentsKeeping PowerShell up-to-date via WSUS.
Hi, folks. This is a quick one to let any fellow hybrid operators know that PowerShell (as distinct from Windows PowerShell) can be kept up-to-date via WSUS these days. Product and Classifications You can find the PowerShell products listed as shown below, while within the Classifications tab, you want to have the "Updates" category checked. After WSUS synchronisation You'll see it's now aware of the various 7.x branches. After client synchronisation to WSUS You'll see the various updates pending approval for deployment. (Yes, my PowerShell's very old now!) A nice little win for the keeping the small things in (my) life current for zero extra effort. Cheers, Lain492Views2likes0CommentsUnexpected Automatic Windows Server Updates Despite GPO and WSUS Configurations
Hello everyone, I am experiencing a disruptive issue across a number of our Windows servers (ranging from Server 2012 to Server 2022). Despite a carefully managed WSUS implementation and GPO enforcement for Windows Updates, we have been facing an issue where several updates are getting automatically installed on these servers. The problem is, these updates are not ones we have explicitly approved, nor are they manually triggered for download/installation. The automatic reboots following these installations are causing significant service disruptions. Furthermore, the behavior seems to be somewhat random, which makes it even more challenging to root cause. Here is a summary of the GPO and WSUS configurations, and what I have verified so far: The GPO for Windows Updates is configured to '4 - Auto download and schedule the install'. The RSOP confirmed that there are no conflicting GPOs. WSUS is functioning correctly and the automatic approval of updates has been disabled. Dual Scan is not a factor as it's not relevant to the Windows Server versions we're using. It has been confirmed that the updates in question are indeed WSUS updates, but they haven’t been approved by us. The issue does not pertain to pre-downloaded update files or Service Stack Updates (SSUs). Given the above points, I am having a hard time figuring out why these updates are being installed and causing unplanned reboots. I would really appreciate it if anyone who has encountered a similar issue or anyone with insights could shed some light on this. Thank you in advance for your assistance! Best3.6KViews1like3CommentsWSUS Clients 'not reported', unknown updates '4'
Hi Everyone, I am using the following powershell script to provide end of WSUS reporting capabilities https://www.experts-exchange.com/articles/27419/How-to-send-automatically-an-e-mail-with-a-report-of-computers-status-inside-WSUS-server.html Yet I note two VMs in the report (one is the WSUS server) returning "Not reported Yet", Unknown '4' WSUS Server is running Windows Server 2012 Standard The other is running Windows Server 2016 Datacenter (and says update history "no updates have been installed yet") which is incorrect. I'm assuming this is because we renamed the C:\windows\SoftwareDistribution after stopping bits,crypto,windows update services then restarting. # Status Server IP Address Last Contact Total Pend reboot Install Ready Pending DL Failed Unknown 110 Not reported yet Server IP, 7 06/15/2021 08:40:49 4 0 0 0 0 4 42 Not reported yet Server IP 06/15/2021 11:16:57 4 0 0 0 0 4 Has anyone come across this behavior and know how to resolve? Thanks.1.3KViews1like0CommentsWindows Server 2016 does not install updates at scheduled time
We have an OU for servers that we don't mind if they install Windows Updates and reboot nightly. For some reason, the Server 2016 servers in that OU do not automatically install updates at the time scheduled by the GPO. The settings on the servers appear to be applied correctly, and it does detect that there are updates available... it just doesn't install them at the scheduled time. Settings from relevant Windows Update GPO: WU settings on the server: WU Restart Options on the Server: WU Policy Registry settings on the server: Any suggestions as to why this may be?Solved7.1KViews1like5Commentserror 0x80070661
Hello. We have 114 virtual machines with windows 2008 r2, all with the first year license active. In March we activated the second year license on all 2008R2 servers. They all update through WSUS but there are 4 servers with an active second-year ESU license that do not update. The error is the same in all four. The error is 0x80070661. All other 2008R2 servers update successfully. I have uninstalled and reinstalled the ESU 2nd year license but the problem persists. I do not see what the problem is. Thank you7.5KViews1like0Comments2021-05 Cumulative Update for Windows Server 2019 for x64-based Systems (KB5003171): Not Applicable
2021-05 Cumulative Update for Windows Server 2019 for x64-based Systems (KB5003171) is downloaded in WSUS and approved for installation. It is showing not applicable. I have tons of Windows Server 2019 servers. I have two separate WSUS on different environment and both showing the same status as not applicable. Anyone seeing this issue? Thanks13KViews1like6Comments