Get your LIMS URL:
Get-IISSite | Select-Object Name, Id, Bindings
The binding output shows your URL - use this as
in all commands below
Find your IIS sites and app pools:
Get-IISSite
Get-IISAppPool
Find your actual LIMS folder location:
Get-WebApplication | Select-Object Path, PhysicalPath
Get-IISSite | Select-Object Name, Applications
Find your IIS log location:
Get-WebConfigurationProperty -Filter "system.webServer/httpLogging" -Name "directory"
# Or check common locations
Test-Path "C:\inetpub\logs\LogFiles\"
Test-Path "F:\inetpub\logs\LogFiles\"
Test-Path "D:\inetpub\logs\LogFiles\"
Replace these placeholders with your real values:
To get
:
Run Get-IISSite | Select-Object Name, Id, Bindings
and use the part after the last colon
To get other placeholders:
= Real app pool name from Get-IISAppPool
= Real site name from Get-IISSite
= Real physical path from Get-WebApplication
= Real log directory path from Get-WebConfigurationProperty
= Real site ID number from Get-IISSite
= Real server name from connection string
= Real domain name from bindingsProblem: Users get "Service Unavailable"
# First, find all app pool names
Get-IISAppPool
# Check specific app pool status (replace <APP_POOL_NAME> with real name from above)
Get-IISAppPool -Name "<APP_POOL_NAME>"
# Start stopped app pool (replace <APP_POOL_NAME> with real name from above)
Start-IISAppPool -Name "<APP_POOL_NAME>"
# Restart app pool (replace <APP_POOL_NAME> with real name from above)
Restart-WebAppPool -Name "<APP_POOL_NAME>"
Problem: Users see "Internal Server Error"
# First, find your site ID and log path
Get-IISSite | Select-Object Name, Id, Bindings
Get-WebConfigurationProperty -Filter "system.webServer/httpLogging" -Name "directory"
# Go to log folder (replace <LOG_PATH> and <SITE_ID> with real values from above)
Set-Location "<LOG_PATH>\W3SVC<SITE_ID>"
# Find recent 500 errors
Get-Content *.log | Where-Object { $_ -match "500" }
# Get last 50 error lines
Get-Content *.log | Select-String "500" | Select-Object -Last 50
Problem: "Cannot connect to database"
# First, find your LIMS folder
Get-WebApplication | Select-Object Path, PhysicalPath
# Check connection string (replace <LIMS_PATH> with real path from above)
Select-String -Path "<LIMS_PATH>\web.config" -Pattern "connectionstring" -CaseSensitive:$false
# This shows output like:
# <add name="DefaultConnection" connectionString="Server=DB-SERVER01;Database=LIMS_DB;..." />
# <add name="DefaultConnection" connectionString="Data Source=ORACLE-SERVER:1521/LIMS_DB;..." />
# <add name="DefaultConnection" connectionString="Host=MYSQL-SERVER;Port=3306;Database=LIMS_DB;..." />
# Extract server name from the connection string:
# SQL Server: Look for "Server=" or "Data Source="
# MySQL: Look for "Server=" or "Host="
# PostgreSQL: Look for "Host="
# Oracle: Look for "Data Source=" (before the colon)
# Example server names from above: DB-SERVER01, ORACLE-SERVER, MYSQL-SERVER
# Use the real server name as <DATABASE_SERVER> below:
# Test database connection (replace <DATABASE_SERVER> and <PORT> with real values)
Test-NetConnection -ComputerName "<DATABASE_SERVER>" -Port <PORT>
# Common database ports:
# SQL Server = 1433
# MySQL = 3306
# PostgreSQL = 5432
# Oracle = 1521
# For SQL Server specifically:
Invoke-Sqlcmd -ServerInstance "<DATABASE_SERVER>" -Query "SELECT 1"
Problem: Users can't upload files
# Check disk space on all drives
Get-WmiObject -Class Win32_LogicalDisk | Select-Object DeviceID, Size, FreeSpace
# First, find your LIMS folder
Get-WebApplication | Select-Object Path, PhysicalPath
# Check permissions (replace <LIMS_PATH> with real path from above)
Get-Acl "<LIMS_PATH>" | Select-Object -ExpandProperty Access | Where-Object { $_.IdentityReference -like "*IIS_IUSRS*" }
# Check if upload directory exists (replace <LIMS_PATH> with real path from above)
Test-Path "<LIMS_PATH>\uploads"
Get-Acl "<LIMS_PATH>\uploads"
Problem: LIMS is slow
# Check IIS worker processes
Get-Process w3wp | Select-Object Id, ProcessName, CPU, WorkingSet
# Check performance counters
Get-Counter "\Processor(_Total)\% Processor Time" -MaxSamples 5
# Check memory usage
Get-Process w3wp | Select-Object ProcessName, WorkingSet, PagedMemorySize
# First, find your site and app pool names
Get-IISSite | Select-Object Name
Get-IISAppPool | Select-Object Name
# Restart specific website only (replace <SITE_NAME> with real name from above)
Stop-IISSite -Name "<SITE_NAME>"
Start-IISSite -Name "<SITE_NAME>"
# Restart specific app pool (replace <APP_POOL_NAME> with real name from above)
Restart-WebAppPool -Name "<APP_POOL_NAME>"
# Full IIS restart
Restart-Service W3SVC -Force
# Reset IIS completely
& "$env:windir\system32\inetsrv\iisreset.exe"
# First, find your site and app pool names
Get-IISSite | Select-Object Name
Get-IISAppPool | Select-Object Name
# Get site bindings (replace <SITE_NAME> with real name from above)
Get-IISSiteBinding -Name "<SITE_NAME>"
# Get app pool settings (replace <APP_POOL_NAME> with real name from above)
Get-IISAppPool -Name "<APP_POOL_NAME>" | Select-Object *
# Check authentication settings (replace <SITE_NAME> with real name from above)
Get-WebConfiguration -Filter "system.webServer/security/authentication/*" -PSPath "IIS:\Sites\<SITE_NAME>"
# Check application settings (replace <SITE_NAME> with real name from above)
Get-WebApplication -Site "<SITE_NAME>"
# First, find your site name and LIMS path
Get-IISSite | Select-Object Name
Get-WebApplication | Select-Object Path, PhysicalPath
# Check failed request tracing (replace <SITE_NAME> with real name from above)
Get-WebConfiguration -Filter "system.webServer/tracing/traceFailedRequests" -PSPath "IIS:\Sites\<SITE_NAME>"
# Check SSL certificate (replace <YOUR_DOMAIN> with real domain name)
Get-ChildItem Cert:\LocalMachine\My | Where-Object { $_.Subject -like "*<YOUR_DOMAIN>*" }
# Check IIS modules
Get-WebManagedModule
# Check connection strings in all configs (replace <LIMS_PATH> with real path from above)
Get-ChildItem -Path "<LIMS_PATH>" -Recurse -Include "*.config" | Select-String "connectionstring" -CaseSensitive:$false
# Test if LIMS server is reachable
Test-NetConnection <LIMS_URL>
Test-NetConnection <LIMS_URL> -Port 80
Test-NetConnection <LIMS_URL> -Port 443
# DNS lookup
Resolve-DnsName <LIMS_URL>
Resolve-DnsName <LIMS_URL> -Server 8.8.8.8
# Trace route to server
Test-NetConnection <LIMS_URL> -TraceRoute
# Test web server response
Invoke-WebRequest -Uri https://<LIMS_URL> -Method Head
Invoke-WebRequest -Uri http://<LIMS_URL> -Method Head
# Test with detailed output
Invoke-WebRequest -Uri https://<LIMS_URL> -Verbose
# Test specific endpoint
Invoke-WebRequest -Uri https://<LIMS_URL>/api/health -Method Head
Invoke-WebRequest -Uri https://<LIMS_URL>/login -Method Head
# Download response body
Invoke-WebRequest -Uri https://<LIMS_URL>/api/status
# Test with custom headers
$headers = @{"Authorization" = "Bearer token123"}
Invoke-WebRequest -Uri https://<LIMS_URL>/api/data -Headers $headers
# Show network configuration
Get-NetIPConfiguration
Get-NetAdapter
# Show DNS cache
Get-DnsClientCache
# Clear DNS cache
Clear-DnsClientCache
# Show network connections
Get-NetTCPConnection | Where-Object {$_.LocalPort -eq 80 -or $_.LocalPort -eq 443}
Get-NetTCPConnection | Where-Object {$_.State -eq "Established"}
# Show routing table
Get-NetRoute
# Show processes using network
Get-NetTCPConnection | Select-Object LocalAddress, LocalPort, RemoteAddress, RemotePort, State, @{Name="Process";Expression={(Get-Process -Id $_.OwningProcess).ProcessName}}
# Check SSL certificate
$cert = Invoke-WebRequest https://<LIMS_URL>
$cert.BaseResponse.ServerCertificate
# Get certificate details
$request = [System.Net.WebRequest]::Create("https://<LIMS_URL>")
$response = $request.GetResponse()
$cert = $request.ServicePoint.Certificate
$cert | Select-Object Subject, Issuer, GetExpirationDateString
Test-NetConnection <LIMS_URL>
Resolve-DnsName <LIMS_URL>
Test-NetConnection <LIMS_URL> -Port 443
Measure-Command { Invoke-WebRequest -Uri https://<LIMS_URL> }
Test-NetConnection <LIMS_URL> -TraceRoute
$request = [System.Net.WebRequest]::Create("https://<LIMS_URL>")
try { $response = $request.GetResponse() } catch { $_.Exception.Message }
Invoke-WebRequest -Uri https://<LIMS_URL>/api/health -Method Head
Invoke-WebRequest -Uri https://<LIMS_URL>/api/status -Verbose
Resolve-DnsName <LIMS_URL>
Resolve-DnsName <LIMS_URL> -Server 8.8.8.8
Clear-DnsClientCache