Following table is result from this decision path.
Windows version | Default PowerShell version | Windows Management Framework (WMF) 5.1 | IIS version | Script type | API, Interface | Remoting |
---|---|---|---|---|---|---|
Windows Server 2022 | 5.1 | Installed by default | 10 | PS Script / VBScript (no PS Module) | PS Module, WMI, AppCmd.exe | PS Remoting / WMI Remoting |
Windows Server 2019 | 5.1 | Installed by default | 10 | PS Script / VBScript (no PS Module) | PS Module, WMI, AppCmd.exe | PS Remoting / WMI Remoting |
Windows Server 2016 | 5.1 | Installed by default | 10 | PS Script / VBScript (no PS Module) | PS Module, WMI, AppCmd.exe | PS Remoting / WMI Remoting |
Windows Server 2012 R2 | 4.0 | Needs to be installed | 8.5 | PS Script / VBScript (no PS Module) | PS Module, WMI, AppCmd.exe | PS Remoting / WMI Remoting |
Windows Server 2012 | 3.0 | Needs to be installed | 8 | PS Script / VBScript (no PS Module) | PS Module, WMI, AppCmd.exe | PS Remoting / WMI Remoting |
Windows Server 2008 R2 SP1 | 2.0 | Needs to be installed | 7.5 | PS Script / VBScript (no PS Module) | PS Module, WMI, AppCmd.exe | PS Remoting / WMI Remoting |
Windows Server 2008 | N/A | N/A | 7.0 | VBScript | WMI, AppCmd.exe | WMI Remoting |
Windows Server 2003 | N/A | N/A | 6.0 | VBScript | WMI | WMI Remoting |
Note
-
IISAdministration PowerShell module is available only in IIS 10.
-
PowerShell (old) module for IIS is WebAdministration.
-
Get-ComputerInfo PowerShell module requires WMF 5.1 to be installed.
-
WebAdministration WMI Namespace requires IIS Management Scripts and Tools Windows feature enabled.
-
WMI Namespaces for IIS 7.0 and later is \ROOT\WebAdministration.
-
WMI Namespaces for IIS 6.0 is \ROOT\MicrosoftIISv2.
-
AppCmd.exe is the single command line tool for managing IIS 7 onward.
For Windows Server 2003, see this document
Applicable for: Windows Server 2008, 2012, 2016
Following apps need to be allowed to communicate through firewall:
- Windows Management Instrumentation (WMI)
Applicable for: Windows Server 2019, Windows Server 2022
Following apps need to be allowed to communicate through firewall:
- Windows Management Instrumentation (WMI)
Following services need to be started on target/remote computer:
- Windows Management Instrumentation
A local or domain user account in the Administrtor group is required.
IIS Server Info Collector and Runner VBScripts are provided.
-
Following these steps to query IIS information on local computer (localhost):
-
Open Command Prompt (CMD)
-
Type
cscript iis-server-info-collector-runner.vbs
then press Enter -
The script will produce some output to console and generate CSV file in C:\iis-info folder with filename format as
{DNS Hostname}_output.csv
-
-
Following these steps to query IIS information on remote computer(s):
-
Create a text file contains a list of remote computer hostname(s) like this:
server1 server2 server3.example.com
-
Open Command Prompt (CMD)
-
Type
cscript iis-server-info-collector-runner.vbs {path to text file from step 1}
then press Enter -
You will be asked whether you're running the script on a computer lives in the same domain as remote computer(s) or not.
- If Yes, enter y. The script will use current logged in account for remote authentication.
- If No, you have to enter username and password for login to remote computer(s). This usename should be able to login to all remote computer(s) (e.g. domain user) listed in the text file in the step 1.
The script will produce some output to console and generate CSV file for each remote computer in C:\iis-info folder with filename format as
{DNS Hostname}_output.csv
. In case of there are more than 1 remote computers, the script will also genereate aiis-info-all.csv
file that all*_output.csv
content are merged. -
Applicable for: Windows Server 2008, 2012, 2016
Following apps need to be allowed to communicate through firewall:
- Windows Remote Management
Applicable for: Windows Server 2019, Windows Server 2022
Following apps need to be allowed to communicate through firewall:
- Windows Remote Management
Following services need to be started on target/remote computer:
- Windows Remote Management (WS-Management)
A local or domain user account in the Administrtor group is required.
IIS Server Info Collector and Runner PowerShell scripts are provided. The steps to run the script are same as in the WMI Remoting section except the script name - use .ps1
script instead of .vbs
.