UAT_Connectivity_Test.ps1 is a PowerShell script designed to automate network connectivity validation in User Acceptance Testing (UAT) or production environments.
It checks connectivity to critical intranet and internet resources, logs results with timestamps, and exports them into an Excel report for easy review.
This is especially useful for IT support specialists and network engineers validating infrastructure availability (servers, DNS, email, SAP, etc.) before sign-off or during troubleshooting.
- ✅ Auto-dependency check – Installs the required ImportExcel module if missing.
- ✅ Dynamic local IP detection – Captures the machine’s current IPv4 address.
- ✅ Predefined test cases – Includes common corporate servers (intranet, DNS, AD, SAP, Outlook, Google, etc.).
- ✅ Ping connectivity tests – Verifies reachability and round-trip response.
- ✅ Timestamped results – Records when each test was executed.
- ✅ Excel export – Saves results into a structured
.xlsxfile for reporting and auditing.
- Windows PowerShell 5.1 or PowerShell 7+
- Internet access (for
Install-Moduleand external tests like Google) - Execution Policy allowing script execution:
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
- Clone or download this repository. You can also download the PS1 file here.
- Open PowerShell as Administrator.
- Run the script:
.\UAT_Connectivity_Test.ps1
- After execution, check the generated Excel file on your Desktop (default output path will be the script’s directory).
| Test ID | Description | Target | Host |
|---|---|---|---|
| TC001 | Ping Example shared drive | Intranet | Example01 |
| TC002 | Ping Google | Internet | google.com |
| TC004 | Ping DNS Server 1 | Intranet | 10.121.23.154 |
| TC006 | Ping Domain AD | Intranet | example.org |
| TC008 | Ping Outlook Email | Internet | outlook.office.com |
- Results are exported into an Excel file (
UAT_Connectivity_Result.xlsx). - Each row includes:
- Test ID
- Description
- Target (Intranet/Internet)
- Host
- Ping status (Success/Fail)
- Response time (ms)
- Timestamp
- Local IP used
By default the output will be saved on your Desktop. However you can change it in the file. Navigate to the code below and change the $ExcelPath = "$env:________" .
# Export to Excel
$excelPath = "$env:USERPROFILE\Desktop\UAT_Connectivity_Results.xlsx"
$results | Export-Excel -Path $excelPath -AutoSize -Title "UAT Connectivity Test Results"
You can add or remove test cases by modifying the $targets array in the script:
$targets = @(
@{ ID = "TC010"; Description = "Ping Custom Server"; Target = "Intranet"; Host = "mycustomserver.local" }
)- Run with sufficient privileges for accurate network tests.
- Useful for troubleshooting network issues, pre-deployment checks, or validating infrastructure during UAT sign-off.
Below is an example of the Excel-style results generated by the script:
Hope this script is somewhat useful and feel free to modify according to your needs.
