Recently I worked with one of the customer, who wanted assistance in displaying the Process-Id, Application Pool Name and the Request StartTime of the IIS Worker Process (w3wp.exe) in IIS 7.X and higher through Powershell.
This blog includes the script which will serve the customer’s above requirement.
Pre-Requisites for running the below script:
1. We need IIS 7.X and higher version installed on the WebServer along with the IIS Management Scripts and Tools Feature installed. This feature is needed to gain access to the root/WebAdministration namespace which we use to query the IIS related information.
2. We need the Powershell to run the script.
3. Make sure that you are an Administrator on the Server where you will be running this script.
How to run the script:
1. You can modify the below script as per your environment and place it a file with extension .ps1 and run it through elevated powershell window.
2. Alternatively, You can also run the script through PowerShell ISE.
Using the Code:
|