How to obtain versions of Internet Information Server (IIS)

Introduction

This sample provides a script for IT pro or windows customers to quickly determine their versions of Internet Information Server (IIS).

For the VBScript version, please visit https://gallery.technet.microsoft.com/How-to-obtain-versions-of-f6dbacbf

Scenarios

IT pro or windows customers might want to know which versions of Internet Information Server (IIS) they are using. While there exists no direct solution to solve the problem out of box,  this sample script can actually offers the tool. Users only need to call the script, and then they will get versions of Internet Information Server (IIS).

Script

Just input the name of the script, and versions of Internet Information Server (IIS) will be shown on the console as the below screenshot.

 

 

PowerShell
Edit|Remove
    $w3wpPath = $Env:WinDir + "\System32\inetsrv\w3wp.exe" 
    If(Test-Path $w3wpPath) { 
        $productProperty = Get-ItemProperty -Path $w3wpPath 
        Write-Host $productProperty.VersionInfo.ProductVersion 
    } 
    Else { 
        Write-Host "Not find IIS." 
    }  

Additional Resources

KB for How to obtain versions of Internet Information Server (IIS)
https://support.microsoft.com/en-us/kb/224609
Microsoft All-In-One Script Framework is an automation script sample library for IT Professionals. The key value that All-In-One Script Framework is trying to deliver is Scenario-Focused Script Samples driven by IT Pros' real-world pains and needs. The team is monitoring all TechNet forums, IT Pros' support calls to Microsoft, and script requests submitted to TechNet Script Repository. We collect frequently asked IT scenarios, and create script samples to automate the tasks and save some time for IT Pros. The team of All-In-One Script Framework sincerely hope that these customer-driven automation script samples can help our IT community in this script-centric move.