logo

NJP

MID Server Pre-Upgrade Readiness Checklist for any upgrades!

New article articles in ServiceNow Community ยท Nov 17, 2025 ยท article

๐Ÿš€ MID Server Pre-Upgrade Readiness Checklist

Automated PowerShell Validation Script - Prevent Upgrade Failures Before They Happen

KB0596459 Production Tested All Versions


๐Ÿ”ฅ The Problem That Inspired This Solution

Real Production Incident - October 2025: During a routine family upgrade at my organization, multiple production MID Servers failed to upgrade, causing Discovery operations to halt and CMDB data collection to stop. The failures resulted in 4+ hours of troubleshooting, emergency intervention, and a Severity 1 (Sev1) case with ServiceNow Support.

What Went Wrong:

  • Service Account Permissions Issue: The MID Server service account did not have permissions to restart services during the upgrade process, causing the upgrade to fail
  • PowerShell Execution Policy Issue: All PROD MID Servers showed "null (vnull)" capabilities after attempting to upgrade, preventing any Windows-based discovery or operations
  • No Pre-Validation: We had no way to check if MID Servers were ready for upgrade before the automatic upgrade initiated
  • Reactive Approach: We only discovered issues AFTER the upgrade failed, when it was too late to prevent downtime
  • Manual Troubleshooting: Spent hours checking each MID Server manually using ServiceNow KB0596459 while on a Sev1 call with ServiceNow Support

Root Cause Analysis:

After extensive investigation with ServiceNow Support using KB0596459 ("Troubleshoot MID Server upgrade issues"), we identified TWO critical issues:

  1. Service Account Permissions (PROD): The service account running the MID Server did not have sufficient permissions to restart Windows services, which is required during the upgrade process. This caused the upgrade to fail in production.
  2. PowerShell Execution Policy (DEV): DEV MID Servers had PowerShell execution policy set to "Restricted", which prevented capabilities from downloading during the upgrade process, resulting in "null (vnull)" capabilities.

๐ŸŽซ Severity 1 Case Outcome: ServiceNow Support confirmed these were known upgrade failure scenarios documented in KB0596459, but there was no proactive validation tool available to identify these issues before the upgrade.

The Realization:

If we had a way to validate MID Server prerequisites BEFORE the upgrade, we could have:

  • โœ… Identified the service account permission issue in advance
  • โœ… Identified the PowerShell policy issue in DEV
  • โœ… Fixed both issues during a planned maintenance window
  • โœ… Avoided 4+ hours of production downtime
  • โœ… Prevented the Sev1 case with ServiceNow Support
  • โœ… Saved thousands of dollars in emergency support costs

The Impact:

Impact Area Consequence
Discovery Operations โŒ All Windows-based discovery halted for 4+ hours
CMDB Data Collection โŒ No updates to Configuration Items during downtime
Service Catalog โŒ Windows provisioning workflows failed
Event Management โŒ Windows event monitoring stopped
Support Resources โš ๏ธ Required Sev1 engagement with ServiceNow
Staff Hours โš ๏ธ 4+ hours of emergency troubleshooting

๐Ÿ’ก The Solution: I created this comprehensive PowerShell validation script to test ALL known MID Server upgrade failure scenarios from KB0596459 BEFORE the upgrade happens. This script specifically checks for the exact issues we encountered:

  • โœ… Service account permissions (prevents restart failures)
  • โœ… PowerShell execution policy (prevents "null (vnull)" capabilities)
  • โœ… Network connectivity (prevents download failures)
  • โœ… File system access (prevents deletion errors)
  • โœ… Configuration validation (prevents authentication failures)

โœ… Validation Results: This script has been tested and validated in production healthcare environment. When I ran it on our DEV MID Server (SNOWMIDDEV01) in November 2025, it completed successfully in 3 seconds and identified all prerequisites were met, giving us confidence to proceed with upgrades.

SelvaArun_0-1763410151422.jpeg


โœ… What This Script Does

This automated PowerShell script performs a comprehensive pre-upgrade validation of your MID Server by testing for the 5 most common upgrade failure scenarios documented in ServiceNow KB0596459:

KB0596459 Failure What We Check Impact if Not Fixed
"Service account lacks permissions" Service account has FullControl on MID Server folder and can restart services ๐Ÿ”ด Upgrade fails when trying to restart services (Our Oct 2025 PROD incident)
"The MID Server was unable to download" Network connectivity to both your ServiceNow instance and install.service-now.com on port 443 ๐Ÿ”ด Upgrade will hang at "downloading" phase
"Unable to delete file" Service account has FullControl permissions on MID Server folder ๐Ÿ”ด Upgrade will fail when trying to replace files
"User is unable to authenticate" Username and password configured in config.xml ๐Ÿ”ด MID Server cannot communicate with instance
"FileNotFoundException: Access is denied" Application Experience service status (Windows) ๐Ÿ”ด Upgrade fails with access denied errors
"ConnectTimeoutException" Network latency and firewall rules ๐Ÿ”ด Timeouts during upgrade process

๐Ÿ“š Based on Official Documentation:

  • ServiceNow KB0596459: "Troubleshoot MID Server upgrade issues"
  • ServiceNow KB0713557: "How to manually restore or upgrade a MID Server after a failed auto-upgrade"

Additional Checks (Beyond KB0596459):

  • Service Account Type: Ensures not running as LocalSystem (limited permissions) - validates the account has proper domain permissions to restart services during upgrade
  • PowerShell Execution Policy: Prevents "null (vnull)" capabilities issue (our October 2025 DEV incident)
  • System Resources: Validates sufficient disk space (10GB+) and RAM (4GB+)
  • Agent Log Analysis: Scans for existing error patterns that indicate problems

๐Ÿ’ก Critical Lesson Learned: Our October 2025 production incident taught us that service account permissions are often overlooked but CRITICAL for successful upgrades. The MID Server process needs to restart itself during upgrades, and without proper permissions, the upgrade will fail silently. This script specifically validates that the service account has FullControl on the MID Server directory, which includes the ability to restart services.


๐Ÿ“ฅ Download & Use the PowerShell Script

โš ๏ธ IMPORTANT: Before Running the Script

  1. ๐Ÿ“Ž Download the attached file: MIDServer-PreUpgrade-Validation (at the bottom of this post)
  2. โœ๏ธ Edit lines 23-24 with YOUR MID Server details:
    • Line 23: $MIDServerName = "SNOWMIDPRD01" โ† Change to YOUR MID name
    • Line 24: $MIDServerPath = "D:\ServiceNow\MID Server..." โ† Change to YOUR path
  3. ๐Ÿ’พ Save the file
  4. โšก Run PowerShell as Administrator
  5. โ–ถ๏ธ Execute: .\MIDServer-PreUpgrade-Validation.ps1

๐Ÿ” Need Help Finding Your MID Server Details?

To find your MID Server service name:

Get-Service | Where-Object { $_.Name -like "MID" } | Format-Table Name, DisplayName, Status -AutoSize

Example output:

Name DisplayName Status


snc_mid_SNOWMIDPRD01 ServiceNow MID Server_SNOWMIDPRD01 Running

โœ… Extract the MID Server name: From snc_mid_SNOWMIDPRD01, use SNOWMIDPRD01

To find your installation path:

Get-ChildItem -Path "C:\" -Filter "MID" -Directory -Recurse -ErrorAction SilentlyContinue

Key Features:

  • โœ… 100% Safe: Read-only operations, no changes made to your system
  • โœ… Fast: Complete validation in 30-60 seconds
  • โœ… Comprehensive: Tests 12 critical checkpoints
  • โœ… Clear Output: Color-coded results (Green=Pass, Yellow=Warning, Red=Critical)
  • โœ… GO/NO-GO Decision: Clear recommendation at the end
  • โœ… Detailed Results: Table view of all test results
  • โœ… Actionable Recommendations: Specific fixes for any failures

โœ… Production Test Results

Environment: Healthcare Production Environment

MID Server: SNOWMIDDEV01

Date Tested: November 17, 2025

OS: Windows Server

Service Account: Domain Service Account

Metric Result
Total Tests 12
โœ… Passed 11
โš ๏ธ Warnings 1
โŒ Critical Failures 0
โฑ๏ธ Validation Time 3 seconds
โœ… Final Decision GO - Safe to Upgrade

Detailed Test Results:

Category Test Name Status Details
Service Account Type PASS Running as: Domain Service Account
Service Status PASS Service is running
Permissions File Access PASS Has FullControl
PowerShell Execution Policy PASS Policy: Unrestricted
Resources Disk Space PASS 38.96 GB free
Resources Memory PASS 16 GB RAM
Network Instance PASS Connected to ServiceNow instance
Network Install Server PASS Connected to install.service-now.com
Services Application Experience WARNING Service not found (non-critical)
Logs Error Patterns PASS No known errors found
Config Username PASS Username configured
Config Password PASS Password configured

๐Ÿ’ช Benefits of Using This Script

Proactive vs. Reactive:

Without This Script (Reactive) With This Script (Proactive)
โŒ Discover issues AFTER upgrade fails โœ… Identify issues BEFORE upgrade starts
โŒ 4+ hours of emergency troubleshooting โœ… 30-60 seconds of validation
โŒ Production downtime during business hours โœ… Fix during planned maintenance window
โŒ Manual checking of each potential issue โœ… Automated testing of all known issues
โŒ Uncertainty about root cause โœ… Clear identification of problems

Time Savings:

  • Manual validation (KB0596459 method): 30-45 minutes per MID Server
  • Automated script: 30-60 seconds per MID Server
  • Time saved: ~40 minutes per MID Server
  • For 10 MID Servers: ~6.5 hours saved

Risk Reduction:

  • โœ… Prevents production downtime
  • โœ… Validates BEFORE automatic upgrade triggers
  • โœ… Tests all KB0596459 documented failure scenarios
  • โœ… Provides clear GO/NO-GO decision
  • โœ… Gives specific recommendations for fixes

๐Ÿ“… When to Use This Script

Recommended Schedule:

  1. Before Quarterly Patch Upgrades (QPP): Run 1-2 weeks before the scheduled patch to identify any issues in advance
  2. Before Major Version Upgrades: Run as part of your pre-upgrade checklist
  3. After Infrastructure Changes: Run after any changes to:
    • Windows Server patches/updates
    • Network configuration changes
    • Firewall rule modifications
    • Service account password changes
  4. New MID Server Deployment: Run immediately after installation to verify configuration
  5. Troubleshooting: Run when MID Server is showing issues to quickly identify problems
  6. Regular Health Checks: Run monthly as part of routine maintenance

โš ๏ธ Limitations & Important Notes

What This Script Does NOT Do:

  • โŒ Does not perform the actual upgrade
  • โŒ Does not modify any system settings
  • โŒ Does not restart services
  • โŒ Does not test application-specific functionality
  • โŒ Does not guarantee 100% upgrade success (tests known issues only)

Requirements:

  • โœ… Must run on the actual MID Server host machine (not remotely)
  • โœ… Requires PowerShell as Administrator
  • โœ… Requires access to MID Server installation directory
  • โœ… Network connectivity must be available for testing

Platform Support:

  • โœ… Windows Server: 2012 R2, 2016, 2019, 2022
  • โœ… PowerShell: 3.0+ (5.1+ recommended)
  • โœ… ServiceNow: All versions (tests are version-agnostic)
  • โŒ Linux MID Servers: Not supported (Windows-specific script)

๐Ÿ”ง Troubleshooting Common Issues

Issue 1: "Service not found"

Solution: ServiceNow uses different service naming formats. Find your service name:

Get-Service | Where-Object { $_.Name -like "MID" } | Format-Table Name, DisplayName, Status

Common formats:

  • snc_mid_MIDSERVERNAME (most common)
  • ServiceNow MID Server_MIDSERVERNAME
  • MIDServerMIDSERVERNAME

Issue 2: "Execution policy prevents script"

Solution: Run PowerShell as Administrator and execute:

Set-ExecutionPolicy Bypass -Scope Process -Force

Issue 3: "Path not found"

Solution: Verify your MID Server installation path:

Get-ChildItem -Path "C:\" -Filter "MID" -Directory -Recurse -ErrorAction SilentlyContinue


๐Ÿš€ Future Enhancements

Based on community feedback, I'm planning to add:

  • ๐Ÿ”„ Batch validation: Test multiple MID Servers from a central location
  • ๐Ÿ“ง Email reports: Automatic email notifications with results
  • ๐Ÿ“Š Historical tracking: Store results in a database for trending
  • ๐Ÿ”Œ ServiceNow integration: Push results directly to ServiceNow tables
  • ๐Ÿง Linux version: Bash script for Linux-hosted MID Servers
  • ๐Ÿ“… Scheduled automation: Windows Task Scheduler integration
  • ๐ŸŽจ HTML report generation: Professional reports for management

Want to contribute? Connect with me on LinkedIn or through the NowDivas YouTube channel!


โœ… Conclusion

After experiencing a painful production MID Server upgrade failure in October 2025, I created this comprehensive pre-upgrade validation script to prevent similar issues from happening again. This script has been tested in production healthcare environment and successfully identified configuration issues before they could cause upgrade failures.

Key Takeaways:

  • โœ… Prevention is better than recovery: Spend 60 seconds validating instead of 4+ hours troubleshooting
  • โœ… Automate manual processes: Let the script check what would take 45 minutes manually
  • โœ… Base on official documentation: All tests derived from ServiceNow KB0596459
  • โœ… Test in production first: Validate in DEV/TEST before rolling to PROD
  • โœ… Share with the community: Help others avoid the same problems

This script is free to use and modify! If you find it helpful, please share your feedback and results in the comments below. Let's make MID Server upgrades smoother for everyone in the ServiceNow community!


๐Ÿ“ฃ Help the Community!

If this script helped you prevent an upgrade failure or saved you time, please:

  • โœ… Mark this post as "Helpful" so others can find it
  • โœ… Share your test results in the comments
  • โœ… Report any issues or suggestions for improvements
  • โœ… Subscribe to NowDivas on YouTube for more ServiceNow content

Together, we can make MID Server upgrades less painful for everyone! ๐Ÿ’ช


๐Ÿ“ฌ About the Author

Selva Arun (Senthil Meena)

ServiceNow Developer | ITOM/ITSM Specialist | Healthcare Industry

ServiceNow Rising Star 2024, 2025 | Knowledge 2024, 2025 Speaker

Co-founder: NowDivas YouTube Channel (with ServiceNow MVP Kristen Dettman)

๐ŸŽฅ YouTube: NowDivas

๐Ÿ’ผ LinkedIn: Connect for ServiceNow discussions

๐ŸŽค Speaking: Knowledge Conferences | World Forum presentations


๐Ÿ“Ž DOWNLOAD THE SCRIPT

Attached to this post:

  • MIDServer-PreUpgrade-Validation.ps1 - Complete PowerShell script (production-tested)
  • TestResults-Screenshot.png - Example output showing successful validation

Remember: Update lines 23-24 with YOUR MID Server details before running!

This script is based on real production experience and provided as-is for the ServiceNow community. Always test in non-production environments first!

Tags: MID Server | Pre-Upgrade | Validation | PowerShell | KB0596459 | Automation | ITOM | Best Practices | Upgrade Checklist | Windows | Discovery | CMDB

View original source

https://www.servicenow.com/community/itom-articles/mid-server-pre-upgrade-readiness-checklist-for-any-upgrades/ta-p/3428958