사내에서 Windows Server를 몇대 운용 중입니다. 가상 서버 4대, WAS, DB, WEB, AD, AD2, 격리 서버 등등..
업데이트 할때 마다 귀찮아서 여기저기 찾아서 PowerShell 짜집기 했습니다.
사용 모듈 : PSWindowsUpdate
How to Use PowerShell to Manage Windows Updates (parallels.com)
Windows. Powershell 모듈을 이용하여 Windows Update 하기 (PSWindowsUpdate) :: 페푸리의 Office Server 이야기 (limcm.kr)
PSWindowsUpdate 파워쉘 모듈 | Windows 업데이트 관리 윈도우 OS 허브 (woshub.com)
Manage Windows Updates with PSWindowsUpdate PowerShell Module | Windows OS Hub
You can use the PSWindowsUpdate PowerShell module to manage Windows updates from the command line. The PSWindowsUpdate module is not built into Windows and is available for installation from the…
woshub.com
해당 모듈이 명령어 만으로 설치되지 않아서 패키지 형태로 묶어서 사용 중입니다.
(첨부파일 참조)
업데이트 전체 설치 및 자동 재부팅으로 되어 있습니다.
사용하실 분들은 Windowsupdate.bat의 경로 를 수정해 주시고 관리자 권한으로 실행하셔야 합니다.
* WindowsUpdate.bat
@echo off
if not exist "%WINDIR%\System32\WindowsPowerShell\v1.0\Modules\PSWindowsUpdate" ( md "%WINDIR%\System32\WindowsPowerShell\v1.0\Modules\PSWindowsUpdate" & XCOPY D:\_WindowsUpdate\PSWindowsUpdate %WINDIR%\System32\WindowsPowerShell\v1.0\Modules\PSWindowsUpdate /s /h /e /k
)
powershell.exe -nologo -executionpolicy bypass -noprofile -file "D:\_WindowsUpdate\WindowsUpdate.ps1" >> D:\_WindowsUpdate\LOG\%computername%_%date%.txt
exit
* WindowsUpdate.ps1
#Set-ExecutionPolicy RemoteSigned
Set-ExecutionPolicy RemoteSigned -scope process -Force
Import-Module -Name PSWindowsUpdate
Get-WindowsUpdate
Install-WindowsUpdate -MicrosoftUpdate -AcceptAll -AutoReboot
'Server > Windows Server' 카테고리의 다른 글
[Hyper-V] 예기치 않은 오류가 발생했습니다. 로그온 실패: 사용자는 이 컴퓨터에서는 요청된 로그온 유형을 허가받지 않았습니다.(0x80070569). (0) | 2022.07.27 |
---|---|
IIS Crypto 적용 시 주의? 유의 사항 구버전 MS SQL 연결 - 추천 Cipher Suites (0) | 2022.07.22 |
[PowerShell] Windows Server Backup (0) | 2022.02.24 |
HTTPS 연결(SSL)시 ERR_CONNECTION_RESET 문제. TLS cipher (0) | 2018.08.31 |
[PowerShell] IIS 웹사이트 자동 설정 (0) | 2017.05.23 |