답변:
GUI : 설정, 시스템, 정보
이것이 '적절한'방법인지 확실하지 않지만 이 cmd를 통해 Win10에 대해 발성 / 대화 된 '버전'(1511, 1607 등) 을 얻을 수 있습니다 .
Reg Query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ReleaseId
다음은 빌드 번호를 Win10 'version' ( 상황에 대비하여 백업 링크 [wiki]) 과 연관시키는 Microsoft의 페이지 입니다. 원격 PC에서 빌드 #을 얻을 때 도움이되었습니다.wmic /node:HOSTNAME os get BuildNumber
(Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion" -Name ReleaseId).ReleaseId
(Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion" -Name CurrentBuildNumber).CurrentBuildNumber
하거나 (Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion" -Name CurrentBuild).CurrentBuild
빌드 번호 를 사용해야합니다
Windows 10의 버전 또는 빌드 번호를 확인하면 시간이 지나도 변경되지 않으므로 그다지 도움이되지 않습니다.
첫 번째 문장이 잘못되었다는 것이 밝혀졌습니다. 이전 버전의 Windows에서는 모두 사실 이었지만 지금은 새로운 Windows 10 세계에 있습니다. 최신 내부자 빌드에는 10525
"RTM" 에 비해 빌드 수가 있습니다 : 10240
.
명령 행에서 빌드 번호를 얻는 방법에는 여러 가지가 있습니다.
systeminfo.exe
(Get-CimInstance -ClassName Win32_OperatingSystem -Namespace root/cimv2).BuildNumber
(Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion" -Name CurrentBuild).CurrentBuild
세 가지 중 마지막이 가장 빠릅니다.
GUI를 선호하는 경우 winver.exe 또는 대부분의 Windows 데스크톱 응용 프로그램 메뉴 About
항목을 사용할 수 있습니다 Help
.
더 이상 서비스 팩이 없으면 OS의 패치 수준은 설치된 업데이트에 따라 다릅니다. GUI, systeminfo.exe, wmi 등을 찾는 방법에는 여러 가지가 있습니다.
이와 같은 작업을 수행하는 가장 강력하고 권장되는 방법은 PowerShell을 사용하는 것입니다.
Get-HotFix
다음과 같은 것을 보여줍니다.
Source Description HotFixID InstalledBy InstalledOn
------ ----------- -------- ----------- -----------
WIN10 Security Update KB3074663 NT AUTHORITY\SYSTEM 7/17/2015 12:00:00 AM
WIN10 Security Update KB3074667 NT AUTHORITY\SYSTEM 7/21/2015 12:00:00 AM
WIN10 Security Update KB3074674 NT AUTHORITY\SYSTEM 7/24/2015 12:00:00 AM
WIN10 Update KB3074678 NT AUTHORITY\SYSTEM 7/31/2015 12:00:00 AM
지난 10 일 동안 업데이트를 필터링 할 수 있습니다.
Get-Hotfix | Where {$_.InstalledOn -gt $(Get-Date).AddDays(-10) -and $_.Description -eq "Update"}
또는 마지막으로 설치된 세 가지 업데이트를 표시하십시오.
Get-Hotfix | Sort-object InstalledOn -Descending | Select -First 3
특정 업데이트가 설치되어 있는지 확인할 수 있습니다.
if ((get-hotfix -id kb3087916) -ne $null) {"patched..."}
먼저 다음과 같은 최신 패치 kb 번호를 온라인에서 찾을 수 있습니다.
(New-Object Net.WebClient).DownloadString('https://microsoft.com/...')
그런 다음 머신에 존재하는지 확인하십시오.
참고 : 이것은 단지 예일뿐입니다. 현재 이러한 페이지를 나열하는 페이지를 모르므로 여전히 구문 분석해야합니다.
문제는 시간이 지남에 따라 Microsoft가 Windows 10의 기능을 너무 많이 변경하여 앱이나 스크립트가 작동하는지 확인해야한다는 것입니다.
버전 번호를 찾는 것이 아니라 필요한 특정 기능이 시스템에 있는지 확인하는 것이 좋습니다.
WMI에는 현재 Windows 10 버전 (예 : 1607) 또는 전체 빌드 번호 (예 : 10.0.14393.577)를 완전히 식별하는 데 사용할 수있는 속성이 없습니다. 다른 의견에서 언급했듯이이 정보 는 레지스트리에서이 키 아래에 표시됩니다.
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion
해당 키의 다음 값은 winver.exe 프로그램에 의해 표시되는 정보에 해당합니다.
ReleaseID = Version (name based on year/month of release: 1507, 1511, 1607, 1703, etc.)
CurrentBuild or CurrentBuildNumber = OS Build (part before period)
UBR = OS Build (part after period)
또한 버전 번호 는 해당 레지스트리 키의 다음 두 값에 있습니다.
CurrentMajorVersionNumber = 10
CurrentMinorVersionNumber = 0
버전 (예 : 1607)이 변경되거나 내부자 빌드가 설치되면 빌드가 변경됩니다. 그러나 UBR (Update Build Revision)은 Microsoft의 릴리스 목록에 표시된 특정 업데이트로 변경 됩니다 .
PowerShell에서
[System.Environment]::OSVersion.Version
레지스트리 키와 동일하게 Major, Minor 및 Build를 반환하지만 항상 Revision을 0으로보고하는 것 같습니다 . Reddit 사용자의 일부 코드 는 레지스트리의 UBR을 개정 번호로 포함하는 적절한 대체를 제공합니다.
$WinVer = New-Object -TypeName PSObject
$WinVer | Add-Member -MemberType NoteProperty -Name Major -Value $(Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion' CurrentMajorVersionNumber).CurrentMajorVersionNumber
$WinVer | Add-Member -MemberType NoteProperty -Name Minor -Value $(Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion' CurrentMinorVersionNumber).CurrentMinorVersionNumber
$WinVer | Add-Member -MemberType NoteProperty -Name Build -Value $(Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion' CurrentBuild).CurrentBuild
$WinVer | Add-Member -MemberType NoteProperty -Name Revision -Value $(Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion' UBR).UBR
$WinVer
이 질문을 몇 번 받았으므로 게시하겠다고 생각했습니다. 세 가지 방법이 있습니다.
자세한 내용은 여기를 참조하십시오 : http://mythoughtsonit.com/2015/07/what-build-version-of-windows-10-am-i-running/
WMIC QFE GET HotfixID, InstalledOn, Description | FINDSTR /I "KB3081438"
2015 년 8 월 15 일 CU가 설치되어 있는지 확인 비어있는 InstalledOn 날짜는 시스템이 설치를 완료하기 위해 다시 시작되지 않았 음을 나타냅니다.
이전에 게시 된 방법 중 어느 것도 작동하지 않으며 설정 → 정보 섹션 에 표시된대로 OS 빌드를 제공하는 방법이 없습니다 . 누적 업데이트 정보가 없습니다.
이런 식으로 할 수 있습니다
$OSmBuild = (Get-WmiObject Win32_OperatingSystem).Version
if($OSmBuild -eq '10.0.10586')
{
# Windows 10.0.10586.0
$164 = Get-HotFix | where { $_.HotFixID -eq 'KB3140768' }
$122 = Get-HotFix | where { $_.HotFixID -eq 'KB3140743' }
$104 = Get-Hotfix | where { $_.HotfixID -eq 'KB3135173' }
if($104 -and (!($122)) -and (!($164)))
{
Write-Host '104 installed'
}
elseif($104 -and $122 -and (!($164)))
{
Write-Host '122 installed'
}
elseif($104 -and $122 -and $164)
{
Write-Host '164 installed'
}
}
PowerShell 스크립트에서는 항상 한 줄짜리였던 것이 필요하므로 모니터링하기가 더 어렵습니다. 여기에서 업데이트를 볼 수 있습니다.
Microsoft가 패치를 업데이트하여 BuildNumber 수정을 시작하기를 바랍니다.
Win32_OperatingSystem.Version
당신이 묘사하는 방식으로 작동 한다고 말한 적이 없지만 빌드는 변경됩니다 winver
(즉, 스크립트가 잘못되었다고 말하고 있습니다).
레지스트리에서 버전을 가져올 수 있습니다. 이를 수행하기위한 PowerShell 스 니핏은 다음과 같습니다.
function Get-RegistryValue($key, $value) {
(Get-ItemProperty $key $value).$value
}
$a1 = Get-RegistryValue "HKLM:\software\microsoft\windows nt\currentversion" CurrentBuild
$a2 = Get-RegistryValue "HKLM:\software\microsoft\windows nt\currentversion" UBR
Write-Host Version $a1'.'$a2
PowerShell은 항상 답입니다.
Get-CimInstance win32_operatingsystem
추가 정보:
Get-CimInstance Win32_OperatingSystem | Select-Object buildnumber,version
보고:
빌드 번호 버전
----------- -------
10240 10.0.10240
이 정보를 사용하여 해당 정보를 신속하게 얻을 수 있으며,이를 기능으로 구축하고 필요한 경우 전체 함대에서 해당 정보를 가져 오는 데 사용할 수 있습니다.
AD 도메인에서 PowerShell의 Get-ADComputer cmdlet을 사용할 수 있습니다.
Get-ADComputer -Filter {OperatingSystem -eq "Windows 10 Pro"} -Property * | Format-Table Name,OperatingSystem,OperatingSystemVersion -Wrap -Auto
FOR 명령에서 Reg Query를 사용하여 Buildversion을 가져올 수 있습니다 (예 : 1607).
for /f "usebackq skip=2 tokens=3" %f in (`reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ReleaseID`) do (set buildver=%f)
단일 원격 컴퓨터에 대한 Windows 10 버전 및 해당 버전을 표시하는 방법을 찾으려고 할 때 PowerShell 버전 버전이 Windows 버전을 따르는 것으로 나타났습니다.
다음 스크립트를 작성했습니다. 업데이트 완료를 위해 원격 컴퓨터를 다시 시작해야하는지 확인하는 테스트를 추가했습니다.
$OSChecked = (Read-Host "Computer Name?")
if (Test-Connection -ComputerName $OSChecked -Count 1 -ErrorAction SilentlyContinue)
{
if ($((Get-Service WinRM -ComputerName $OSChecked).Status) -eq "stopped")
{
(Get-Service WinRM -ComputerName $OSChecked).Start()
}
Write-Host "`n$((Get-WmiObject win32_computersystem -ComputerName $OSChecked).Name) " -NoNewline ; Invoke-Command -ComputerName $OSChecked -ScriptBlock{if (Get-Item "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired" -ErrorAction SilentlyContinue) {Write-Host "Restart Required!" -BackgroundColor DarkYellow -ForegroundColor White}}
Invoke-Command -ComputerName $OSChecked -ScriptBlock{Write-Host "Version $((Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion").ProductName) $((Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion").ReleaseId), revision $(($PSVersionTable).PSVersion.Revision)"}
}
이것은 이런 유형의 결과를 제공합니다.
Computer_Name Version Windows 10 Enterprise 1703, revision 296
에서 AD의 도메인, 당신은 OU의 모든 컴퓨터를 포함하는 가변하여 하나의 <컴퓨터>를 대체 할 수 있습니다.
Write-Host "Version $((Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion").ProductName) $((Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion").ReleaseId), revision $(($PSVersionTable).PSVersion.Revision)"
,하지만 저를주는 Windows 10 Pro 1803, revision 1000
잘못된 10.0.17730.1000에. 빌드 버전은 17730입니다
준수를 위해 어떤 누적 패치가 설치되어 있는지 확인해야합니다. get-hotfix를 사용하면 나중에 누적 패치가 설치된 경우 문제가 발생합니다. 가장 좋은 해결책은 핫픽스 부분을 포함하여 빌드 번호를 비교하는 것입니다. 명령 줄로 가져 오는 유일한 방법은 PowerShell에서 직접 작동하지 않는 명령 프롬프트 ver 명령을 사용하는 것입니다.
$verstring = cmd.exe /c ver
[version]$Winbuild = [regex]::Match($verstring,"(\d+\.\d+\.\d+\.\d+)").value
if ($verstring -ge [version]"10.0.16299.755") {write-host "Compliant"}