As far as I know, there doesn't seem to be any script or commands which can detect if the current versions of Exchange and windows server are latest.
The available methods are to manually get the current versions, and then compare with the microsoft docs:
1 Navigate to the following location: Control Panel -> Uninstall a program & View installed updates
![enter image description here](../../images/3826846872.webp)
![enter image description here](../../images/3813477504.webp)
2 Run the following commands as administrator in Exchange PowerShell:
$ExchangeServers = Get-ExchangeServer | Sort-Object Name
ForEach ($Server in $ExchangeServers)
{
Invoke-Command -ComputerName $Server.Name -ScriptBlock { Get-Command Exsetup.exe | ForEach-Object { $_.FileversionInfo } }
}
![enter image description here](../../images/3824094364.webp)
![enter image description here](../../images/3851488434.webp)
Or you can navigate to the following location: Control Panel\System and Security\Windows Update\Change settings
, and check the checkbox "Give me updates for other Microsoft products when I update Windows" so that you will get the latest SU versions of Exchange server and patch versions of windows server when checking for updates:
![enter image description here](../../images/3853192382.webp)