IIS版本可通过IIS管理器、命令行、注册表或PowerShell查看:在IIS管理器中查看服务器名称下方版本号;使用appcmd命令获取输出首行信息;查询注册表HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\InetStp下的MajorVersion和MinorVersion值;或通过PowerShell运行Get-ItemProperty命令读取版本号,对应Windows版本如IIS 10.0对应Windows Server 2016及以上。

To check the IIS (Internet Information Services) version on a Windows server, you can use several methods. The most common and reliable ones are described below.

Check IIS Version via IIS Manager

If IIS is installed and the management console is available, this is the easiest way:

Open IIS Manager (press Win + R, type inetmgr, and press Enter).

In the IIS Manager window, look at the top-right corner under the server name.

The version number is displayed below the server name. For example, it might say "IIS 10.0".

Check via Command Line (using appcmd)

You can use the built-in appcmd tool to retrieve IIS version information:

Open Command Prompt as Administrator.

Navigate to the IIS command-line directory:cd %windir%\system32\inetsrv

Run:appcmd

The first line of output typically shows the IIS version, such as "Microsoft Internet Information Services Version 10.0".

Check IIS Version via Registry

The IIS version is stored in the Windows Registry:

Press Win + R, type regedit, and press Enter.

Navigate to:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\InetStp

Look for the MajorVersion and MinorVersion values.

Convert the decimal values to understand the version:

- MajorVersion = 10, MinorVersion = 0 → IIS 10.0

- MajorVersion = 8, MinorVersion = 5 → IIS 8.5

- MajorVersion = 7, MinorVersion = 5 → IIS 7.5

Check Using PowerShell

Run a simple PowerShell command to get IIS version details:

Open PowerShell as Administrator.

Run:(Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\InetStp\').MajorVersion

And:(Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\InetStp\').MinorVersion

Match the numbers to known IIS versions as shown above.

Basically, the quickest way is using IIS Manager if it's accessible. Otherwise, the registry or PowerShell methods are reliable and scriptable. Version numbers align with Windows versions — for example, IIS 10 comes with Windows 10 and Windows Server 2016+. Not complicated, but easy to miss if you don't know where to look.

以上是如何检查IIS版本?的详细内容。更多信息请关注PHP中文网其他相关文章!