ITAppsPanel for Self Support (Powershell and Local Executables)

Modified on Fri, Jul 3 at 9:25 AM

Webinar Take-Away

Self-Service Executables
Troubleshooting with ITAppsPanel

Ideas, guardrails, deployment guidance, and example scripts for common end-user fixes.

Critical Disclaimer

Brainstorming material only. Use entirely at your own risk.

The PowerShell ideas, commands, and sample files in this document are provided solely as educational and brainstorming material. They are not production-ready instructions, managed services advice, security advice, legal advice, or a warranty that any script is safe or appropriate for a particular device, customer, environment, operating system, policy, or configuration.

Invarosoft, the webinar presenters, authors, distributors, and related parties accept no responsibility or liability for any direct, indirect, incidental, consequential, operational, commercial, security, privacy, data-loss, service-interruption, configuration, credential, licensing, compliance, or support impact arising from the review, testing, modification, deployment, execution, or misuse of this material, to the fullest extent permitted by applicable law.

Any MSP, IT provider, administrator, or end customer choosing to use this material is solely responsible for independent technical review, security validation, legal review, change control, customer approval, testing, backups, rollback planning, permissions, logging, monitoring, documentation, and ongoing maintenance.

Do not deploy these examples directly into a production environment without first reviewing and adapting them for your own standards. This disclaimer should itself be reviewed by your legal adviser before publication or commercial use.

Why this matters

ITAppsPanel can launch approved local executables and command files. That creates an opportunity to offer carefully controlled self-service troubleshooting actions to end users, such as repairing network settings, clearing a stuck print queue, restarting collaboration applications, or collecting diagnostic information before a support ticket is escalated.

The idea is simple: turn repeatable Tier 1 troubleshooting into clearly labelled buttons while keeping the scripts centrally controlled, logged, tested, and protected from modification.

Recommended folder structure
C:\ITSupport\
├── Scripts\
├── Logs\
└── Backups\

Five practical script concepts

ScriptTypical usePrimary caution
Repair NetworkDNS failures, limited connectivity, DHCP issuesMay require elevation and restart
Repair M365 Sign-InRepeated sign-in prompts or stale authentication cacheCan sign users out and close apps
Repair PrintingStuck jobs, offline queue, spooler problemsDeletes pending print jobs
Restart Collaboration AppsFrozen Outlook, Teams, OneDrive, or WebView2Unsaved work may be lost
Collect DiagnosticsGather useful support information before escalationReports may contain device and user data

Deployment guardrails

  • Test first: validate every script in a lab and pilot group before production use.
  • Protect the folder: standard users should be able to execute approved scripts but not replace or edit them.
  • Sign scripts: use code signing and an appropriate PowerShell execution policy wherever practical.
  • Use least privilege: only elevate the specific scripts and actions that genuinely require administrator rights.
  • Log actions: record timestamps, computer names, user context, actions attempted, and outcomes.
  • Warn users clearly: scripts that close applications, reset services, delete queues, or require reauthentication should show a confirmation prompt.
  • Plan rollback: document what the script changes and how an engineer can reverse or recover from it.
  • Review privacy: diagnostic reports can contain usernames, device details, IP addresses, event logs, and security information.
Before copying any code below

These examples are intentionally generic. Environment-specific exclusions, endpoint security controls, RMM policies, Intune policies, application versions, customer approvals, and support procedures must be added before use.

Script 1

Repair network and DNS issues

Filename: Repair-Network.ps1

Flushes DNS, renews DHCP, resets Winsock and TCP/IP, and performs connectivity checks.

Risk note: Administrator rights required. A restart may be required.

Save as: C:\ITSupport\Scripts\Repair-Network.ps1

#requires -version 5.1

<#
.SYNOPSIS
    Repairs common Windows network and DNS issues.

.DESCRIPTION
    Flushes the DNS cache, renews DHCP addressing, resets Winsock and TCP/IP,
    and performs basic connectivity tests.

.NOTES
    Requires administrator rights.
    A computer restart may be required.
#>

$ErrorActionPreference = "Continue"

$currentIdentity = [Security.Principal.WindowsIdentity]::GetCurrent()
$principal = New-Object Security.Principal.WindowsPrincipal($currentIdentity)
$isAdmin = $principal.IsInRole(
    [Security.Principal.WindowsBuiltInRole]::Administrator
)

if (-not $isAdmin) {
    Write-Host "Administrator permission is required." -ForegroundColor Yellow

    Start-Process powershell.exe `
        -ArgumentList "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" `
        -Verb RunAs

    exit
}

$logFolder = "C:\ITSupport\Logs"

if (-not (Test-Path $logFolder)) {
    New-Item -Path $logFolder -ItemType Directory -Force | Out-Null
}

$timestamp = Get-Date -Format "yyyyMMdd-HHmmss"
$logFile = Join-Path $logFolder "NetworkRepair-$env:COMPUTERNAME-$timestamp.log"

Start-Transcript -Path $logFile -Force

Write-Host ""
Write-Host "==========================================" -ForegroundColor Cyan
Write-Host "        NETWORK REPAIR UTILITY" -ForegroundColor Cyan
Write-Host "==========================================" -ForegroundColor Cyan
Write-Host ""

Write-Host "Current network configuration:" -ForegroundColor Yellow
Get-NetIPConfiguration | Format-List InterfaceAlias, IPv4Address, IPv4DefaultGateway, DNSServer

Write-Host "Flushing DNS cache..." -ForegroundColor Yellow
ipconfig /flushdns

Write-Host "Clearing the ARP cache..." -ForegroundColor Yellow
arp.exe -d *

Write-Host "Releasing DHCP addresses..." -ForegroundColor Yellow
ipconfig /release

Start-Sleep -Seconds 3

Write-Host "Renewing DHCP addresses..." -ForegroundColor Yellow
ipconfig /renew

Write-Host "Resetting Winsock..." -ForegroundColor Yellow
netsh winsock reset

Write-Host "Resetting the TCP/IP stack..." -ForegroundColor Yellow
netsh int ip reset

Write-Host ""
Write-Host "Testing local TCP/IP..." -ForegroundColor Yellow
Test-Connection -ComputerName "127.0.0.1" -Count 2

Write-Host ""
Write-Host "Testing internet connectivity using 1.1.1.1..." -ForegroundColor Yellow
Test-Connection -ComputerName "1.1.1.1" -Count 2

Write-Host ""
Write-Host "Testing DNS resolution..." -ForegroundColor Yellow

try {
    Resolve-DnsName "www.microsoft.com" -ErrorAction Stop |
        Select-Object Name, Type, IPAddress
}
catch {
    Write-Warning "DNS resolution failed: $($_.Exception.Message)"
}

Write-Host ""
Write-Host "Network repair completed." -ForegroundColor Green
Write-Host "A restart is recommended because Winsock and TCP/IP were reset." -ForegroundColor Yellow
Write-Host "Log saved to: $logFile" -ForegroundColor Cyan

Stop-Transcript
Read-Host "Press Enter to close"
Script 2

Repair Microsoft 365 sign-in

Filename: Repair-M365SignIn.ps1

Closes common Microsoft 365 apps, restarts selected services, clears temporary identity caches, and opens work-account settings.

Risk note: Users may need to sign in again. Unsaved work may be lost.

Save as: C:\ITSupport\Scripts\Repair-M365SignIn.ps1

#requires -version 5.1

<#
.SYNOPSIS
    Performs a conservative repair of Microsoft 365 sign-in components.

.DESCRIPTION
    Closes Microsoft 365 applications, restarts relevant Windows services,
    clears selected temporary authentication cache locations, and opens
    Windows work-account settings.

.WARNING
    The user may need to sign in again after this script runs.
#>

$ErrorActionPreference = "Continue"

$currentIdentity = [Security.Principal.WindowsIdentity]::GetCurrent()
$principal = New-Object Security.Principal.WindowsPrincipal($currentIdentity)
$isAdmin = $principal.IsInRole(
    [Security.Principal.WindowsBuiltInRole]::Administrator
)

if (-not $isAdmin) {
    Write-Host "Administrator permission is required." -ForegroundColor Yellow

    Start-Process powershell.exe `
        -ArgumentList "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" `
        -Verb RunAs

    exit
}

$logFolder = "C:\ITSupport\Logs"

if (-not (Test-Path $logFolder)) {
    New-Item -Path $logFolder -ItemType Directory -Force | Out-Null
}

$timestamp = Get-Date -Format "yyyyMMdd-HHmmss"
$logFile = Join-Path $logFolder "M365SignInRepair-$env:COMPUTERNAME-$timestamp.log"

Start-Transcript -Path $logFile -Force

Write-Host ""
Write-Host "==========================================" -ForegroundColor Cyan
Write-Host "     MICROSOFT 365 SIGN-IN REPAIR" -ForegroundColor Cyan
Write-Host "==========================================" -ForegroundColor Cyan
Write-Host ""
Write-Host "Microsoft 365 applications will be closed." -ForegroundColor Yellow
Write-Host "Unsaved work may be lost." -ForegroundColor Red
Write-Host ""

$confirmation = Read-Host "Type YES to continue"

if ($confirmation -ne "YES") {
    Write-Host "Operation cancelled." -ForegroundColor Yellow
    Stop-Transcript
    exit
}

$processNames = @(
    "OUTLOOK",
    "WINWORD",
    "EXCEL",
    "POWERPNT",
    "ONENOTE",
    "MSACCESS",
    "Teams",
    "ms-teams",
    "OneDrive"
)

foreach ($processName in $processNames) {
    $processes = Get-Process -Name $processName -ErrorAction SilentlyContinue

    if ($processes) {
        Write-Host "Closing $processName..." -ForegroundColor Yellow
        $processes | Stop-Process -Force -ErrorAction SilentlyContinue
    }
}

Start-Sleep -Seconds 3

$serviceNames = @(
    "wlidsvc",
    "TokenBroker",
    "WebClient"
)

foreach ($serviceName in $serviceNames) {
    $service = Get-Service -Name $serviceName -ErrorAction SilentlyContinue

    if ($service) {
        try {
            Write-Host "Restarting service: $serviceName" -ForegroundColor Yellow

            if ($service.Status -eq "Running") {
                Restart-Service -Name $serviceName -Force -ErrorAction Stop
            }
            else {
                Start-Service -Name $serviceName -ErrorAction Stop
            }
        }
        catch {
            Write-Warning "Could not restart $serviceName: $($_.Exception.Message)"
        }
    }
}

$cacheLocations = @(
    "$env:LOCALAPPDATA\Microsoft\Windows\INetCache\*",
    "$env:LOCALAPPDATA\Microsoft\IdentityCache\*"
)

foreach ($cacheLocation in $cacheLocations) {
    Write-Host "Clearing temporary cache: $cacheLocation" -ForegroundColor Yellow

    try {
        Remove-Item -Path $cacheLocation `
            -Recurse `
            -Force `
            -ErrorAction SilentlyContinue
    }
    catch {
        Write-Warning "Some cache files could not be removed."
    }
}

$oneDriveLocations = @(
    "$env:LOCALAPPDATA\Microsoft\OneDrive\OneDrive.exe",
    "$env:ProgramFiles\Microsoft OneDrive\OneDrive.exe",
    "${env:ProgramFiles(x86)}\Microsoft OneDrive\OneDrive.exe"
)

$oneDriveExecutable = $oneDriveLocations |
    Where-Object { Test-Path $_ } |
    Select-Object -First 1

if ($oneDriveExecutable) {
    Write-Host "Starting OneDrive..." -ForegroundColor Yellow
    Start-Process $oneDriveExecutable
}

Write-Host ""
Write-Host "Opening Windows work-account settings..." -ForegroundColor Yellow
Start-Process "ms-settings:workplace"

Write-Host ""
Write-Host "Repair completed." -ForegroundColor Green
Write-Host "The user may need to sign in to Microsoft 365 again." -ForegroundColor Yellow
Write-Host "Log saved to: $logFile" -ForegroundColor Cyan

Stop-Transcript
Read-Host "Press Enter to close"
Script 3

Clear stuck print jobs

Filename: Repair-Printing.ps1

Stops the Print Spooler, removes queued spool files, restarts the service, and displays printer status.

Risk note: Administrator rights required. All pending print jobs are deleted.

Save as: C:\ITSupport\Scripts\Repair-Printing.ps1

#requires -version 5.1

<#
.SYNOPSIS
    Clears stuck print jobs and restarts Windows printing services.

.WARNING
    All pending print jobs on this computer will be deleted.
#>

$ErrorActionPreference = "Continue"

$currentIdentity = [Security.Principal.WindowsIdentity]::GetCurrent()
$principal = New-Object Security.Principal.WindowsPrincipal($currentIdentity)
$isAdmin = $principal.IsInRole(
    [Security.Principal.WindowsBuiltInRole]::Administrator
)

if (-not $isAdmin) {
    Write-Host "Administrator permission is required." -ForegroundColor Yellow

    Start-Process powershell.exe `
        -ArgumentList "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" `
        -Verb RunAs

    exit
}

$logFolder = "C:\ITSupport\Logs"

if (-not (Test-Path $logFolder)) {
    New-Item -Path $logFolder -ItemType Directory -Force | Out-Null
}

$timestamp = Get-Date -Format "yyyyMMdd-HHmmss"
$logFile = Join-Path $logFolder "PrintingRepair-$env:COMPUTERNAME-$timestamp.log"

Start-Transcript -Path $logFile -Force

Write-Host ""
Write-Host "==========================================" -ForegroundColor Cyan
Write-Host "         PRINTING REPAIR UTILITY" -ForegroundColor Cyan
Write-Host "==========================================" -ForegroundColor Cyan
Write-Host ""
Write-Host "This will remove all pending print jobs." -ForegroundColor Yellow

$confirmation = Read-Host "Type YES to continue"

if ($confirmation -ne "YES") {
    Write-Host "Operation cancelled." -ForegroundColor Yellow
    Stop-Transcript
    exit
}

Write-Host ""
Write-Host "Current printers:" -ForegroundColor Yellow

try {
    Get-Printer |
        Select-Object Name, DriverName, PortName, PrinterStatus, Default |
        Format-Table -AutoSize
}
catch {
    Write-Warning "Could not retrieve printer information."
}

Write-Host ""
Write-Host "Current print jobs:" -ForegroundColor Yellow

try {
    Get-Printer | ForEach-Object {
        $printerName = $_.Name

        Get-PrintJob -PrinterName $printerName -ErrorAction SilentlyContinue |
            Select-Object @{Name = "Printer"; Expression = { $printerName } },
                ID,
                DocumentName,
                JobStatus,
                SubmittedTime
    } | Format-Table -AutoSize
}
catch {
    Write-Warning "Could not retrieve all print jobs."
}

Write-Host "Stopping Print Spooler..." -ForegroundColor Yellow
Stop-Service -Name Spooler -Force -ErrorAction SilentlyContinue

Start-Sleep -Seconds 2

$spoolFolder = Join-Path $env:SystemRoot "System32\spool\PRINTERS"

if (Test-Path $spoolFolder) {
    Write-Host "Clearing print queue files..." -ForegroundColor Yellow

    Get-ChildItem -Path $spoolFolder -Force -ErrorAction SilentlyContinue |
        Remove-Item -Force -Recurse -ErrorAction SilentlyContinue
}

Write-Host "Starting Print Spooler..." -ForegroundColor Yellow
Start-Service -Name Spooler -ErrorAction SilentlyContinue

Start-Sleep -Seconds 3

$spooler = Get-Service -Name Spooler

if ($spooler.Status -eq "Running") {
    Write-Host "Print Spooler is running." -ForegroundColor Green
}
else {
    Write-Warning "Print Spooler did not start successfully."
}

Write-Host ""
Write-Host "Printers after repair:" -ForegroundColor Yellow

try {
    Get-Printer |
        Select-Object Name, PrinterStatus, PortName |
        Format-Table -AutoSize
}
catch {
    Write-Warning "Could not retrieve printer information."
}

Write-Host ""
Write-Host "Printing repair completed." -ForegroundColor Green
Write-Host "Log saved to: $logFile" -ForegroundColor Cyan

Write-Host "Opening Windows printer settings..." -ForegroundColor Yellow
Start-Process "ms-settings:printers"

Stop-Transcript
Read-Host "Press Enter to close"
Script 4

Restart Outlook, Teams, and OneDrive

Filename: Restart-CollaborationApps.ps1

Closes collaboration apps, clears selected Teams cache locations, checks Microsoft 365 connectivity, and relaunches apps.

Risk note: Unsaved drafts or work may be lost.

Save as: C:\ITSupport\Scripts\Restart-CollaborationApps.ps1

#requires -version 5.1

<#
.SYNOPSIS
    Restarts Outlook, Microsoft Teams, OneDrive, and WebView2.

.DESCRIPTION
    Closes the applications, clears selected temporary Teams cache folders,
    performs Microsoft 365 connectivity tests, and restarts installed apps.

.WARNING
    Unsaved drafts or documents may be lost.
#>

$ErrorActionPreference = "Continue"

$logFolder = "C:\ITSupport\Logs"

if (-not (Test-Path $logFolder)) {
    New-Item -Path $logFolder -ItemType Directory -Force | Out-Null
}

$timestamp = Get-Date -Format "yyyyMMdd-HHmmss"
$logFile = Join-Path $logFolder "CollaborationApps-$env:COMPUTERNAME-$timestamp.log"

Start-Transcript -Path $logFile -Force

Write-Host ""
Write-Host "==========================================" -ForegroundColor Cyan
Write-Host "   OUTLOOK, TEAMS AND ONEDRIVE RESTART" -ForegroundColor Cyan
Write-Host "==========================================" -ForegroundColor Cyan
Write-Host ""
Write-Host "Unsaved work in these applications may be lost." -ForegroundColor Red

$confirmation = Read-Host "Type YES to continue"

if ($confirmation -ne "YES") {
    Write-Host "Operation cancelled." -ForegroundColor Yellow
    Stop-Transcript
    exit
}

$outlookPaths = @(
    "$env:ProgramFiles\Microsoft Office\root\Office16\OUTLOOK.EXE",
    "${env:ProgramFiles(x86)}\Microsoft Office\root\Office16\OUTLOOK.EXE"
)

$oneDrivePaths = @(
    "$env:LOCALAPPDATA\Microsoft\OneDrive\OneDrive.exe",
    "$env:ProgramFiles\Microsoft OneDrive\OneDrive.exe",
    "${env:ProgramFiles(x86)}\Microsoft OneDrive\OneDrive.exe"
)

$outlookExecutable = $outlookPaths |
    Where-Object { Test-Path $_ } |
    Select-Object -First 1

$oneDriveExecutable = $oneDrivePaths |
    Where-Object { Test-Path $_ } |
    Select-Object -First 1

$processNames = @(
    "OUTLOOK",
    "Teams",
    "ms-teams",
    "OneDrive",
    "msedgewebview2"
)

foreach ($processName in $processNames) {
    $processes = Get-Process -Name $processName -ErrorAction SilentlyContinue

    if ($processes) {
        Write-Host "Closing $processName..." -ForegroundColor Yellow
        $processes | Stop-Process -Force -ErrorAction SilentlyContinue
    }
}

Start-Sleep -Seconds 4

$classicTeamsCacheLocations = @(
    "$env:APPDATA\Microsoft\Teams\Cache\*",
    "$env:APPDATA\Microsoft\Teams\Code Cache\*",
    "$env:APPDATA\Microsoft\Teams\GPUCache\*",
    "$env:APPDATA\Microsoft\Teams\blob_storage\*",
    "$env:APPDATA\Microsoft\Teams\databases\*",
    "$env:APPDATA\Microsoft\Teams\logs\*",
    "$env:APPDATA\Microsoft\Teams\tmp\*"
)

foreach ($cacheLocation in $classicTeamsCacheLocations) {
    if (Test-Path $cacheLocation) {
        Write-Host "Clearing Teams temporary cache..." -ForegroundColor Yellow

        Remove-Item -Path $cacheLocation `
            -Recurse `
            -Force `
            -ErrorAction SilentlyContinue
    }
}

Write-Host ""
Write-Host "Testing Microsoft 365 connectivity..." -ForegroundColor Yellow

$testHosts = @(
    "login.microsoftonline.com",
    "outlook.office.com",
    "teams.microsoft.com",
    "onedrive.live.com"
)

foreach ($testHost in $testHosts) {
    try {
        $testResult = Test-NetConnection `
            -ComputerName $testHost `
            -Port 443 `
            -WarningAction SilentlyContinue

        if ($testResult.TcpTestSucceeded) {
            Write-Host "$testHost : Port 443 reachable" -ForegroundColor Green
        }
        else {
            Write-Warning "$testHost : Port 443 not reachable"
        }
    }
    catch {
        Write-Warning "Could not test $testHost"
    }
}

Write-Host ""
Write-Host "Restarting applications..." -ForegroundColor Yellow

if ($oneDriveExecutable) {
    Start-Process $oneDriveExecutable
    Write-Host "OneDrive started." -ForegroundColor Green
}

try {
    Start-Process "msteams:"
    Write-Host "Teams start request sent." -ForegroundColor Green
}
catch {
    Write-Warning "Teams could not be started automatically."
}

if ($outlookExecutable) {
    Start-Process $outlookExecutable
    Write-Host "Outlook started." -ForegroundColor Green
}
else {
    try {
        Start-Process "outlook.exe"
        Write-Host "Outlook start request sent." -ForegroundColor Green
    }
    catch {
        Write-Warning "Outlook could not be located."
    }
}

Write-Host ""
Write-Host "Application restart completed." -ForegroundColor Green
Write-Host "Log saved to: $logFile" -ForegroundColor Cyan

Stop-Transcript
Read-Host "Press Enter to close"
Script 5

Collect support diagnostics

Filename: Collect-SupportDiagnostics.ps1

Creates a report with Windows, hardware, disk, network, printer, BitLocker, pending-restart, services, process, and event-log information.

Risk note: Designed to be read-only, but output may contain device and user information.

Save as: C:\ITSupport\Scripts\Collect-SupportDiagnostics.ps1

#requires -version 5.1

<#
.SYNOPSIS
    Collects common Windows troubleshooting information.

.DESCRIPTION
    Creates a diagnostic report that can be sent to the IT support team.
    The script does not intentionally change system settings.
#>

$ErrorActionPreference = "Continue"

$logFolder = "C:\ITSupport\Logs"

if (-not (Test-Path $logFolder)) {
    New-Item -Path $logFolder -ItemType Directory -Force | Out-Null
}

$timestamp = Get-Date -Format "yyyyMMdd-HHmmss"
$reportFile = Join-Path $logFolder "SupportDiagnostics-$env:COMPUTERNAME-$timestamp.txt"

function Add-Section {
    param (
        [Parameter(Mandatory)]
        [string]$Title
    )

    Add-Content -Path $reportFile -Value ""
    Add-Content -Path $reportFile -Value ("=" * 78)
    Add-Content -Path $reportFile -Value $Title
    Add-Content -Path $reportFile -Value ("=" * 78)
}

function Add-CommandOutput {
    param (
        [Parameter(Mandatory)]
        [scriptblock]$Command
    )

    try {
        $output = & $Command | Out-String -Width 250
        Add-Content -Path $reportFile -Value $output
    }
    catch {
        Add-Content -Path $reportFile -Value "ERROR: $($_.Exception.Message)"
    }
}

Write-Host ""
Write-Host "==========================================" -ForegroundColor Cyan
Write-Host "      SUPPORT DIAGNOSTICS COLLECTOR" -ForegroundColor Cyan
Write-Host "==========================================" -ForegroundColor Cyan
Write-Host ""
Write-Host "Collecting diagnostic information..." -ForegroundColor Yellow

Set-Content -Path $reportFile -Value "IT SUPPORT DIAGNOSTIC REPORT"
Add-Content -Path $reportFile -Value "Generated: $(Get-Date)"
Add-Content -Path $reportFile -Value "Computer: $env:COMPUTERNAME"
Add-Content -Path $reportFile -Value "User: $env:USERDOMAIN\$env:USERNAME"

Add-Section "OPERATING SYSTEM"

Add-CommandOutput {
    Get-CimInstance Win32_OperatingSystem |
        Select-Object Caption,
            Version,
            BuildNumber,
            OSArchitecture,
            LastBootUpTime,
            InstallDate
}

Add-Section "COMPUTER HARDWARE"

Add-CommandOutput {
    Get-CimInstance Win32_ComputerSystem |
        Select-Object Manufacturer,
            Model,
            TotalPhysicalMemory,
            Domain,
            PartOfDomain,
            UserName
}

Add-CommandOutput {
    Get-CimInstance Win32_BIOS |
        Select-Object Manufacturer,
            SMBIOSBIOSVersion,
            SerialNumber,
            ReleaseDate
}

Add-Section "UPTIME"

Add-CommandOutput {
    $os = Get-CimInstance Win32_OperatingSystem
    $uptime = (Get-Date) - $os.LastBootUpTime

    [PSCustomObject]@{
        LastBoot      = $os.LastBootUpTime
        UptimeDays    = [math]::Floor($uptime.TotalDays)
        UptimeHours   = $uptime.Hours
        UptimeMinutes = $uptime.Minutes
    }
}

Add-Section "PROCESSOR AND MEMORY"

Add-CommandOutput {
    Get-CimInstance Win32_Processor |
        Select-Object Name,
            NumberOfCores,
            NumberOfLogicalProcessors,
            MaxClockSpeed,
            LoadPercentage
}

Add-CommandOutput {
    $os = Get-CimInstance Win32_OperatingSystem

    [PSCustomObject]@{
        TotalMemoryGB = [math]::Round($os.TotalVisibleMemorySize / 1MB, 2)
        FreeMemoryGB  = [math]::Round($os.FreePhysicalMemory / 1MB, 2)
        UsedMemoryGB  = [math]::Round(
            ($os.TotalVisibleMemorySize - $os.FreePhysicalMemory) / 1MB,
            2
        )
    }
}

Add-Section "DISK SPACE"

Add-CommandOutput {
    Get-CimInstance Win32_LogicalDisk -Filter "DriveType=3" |
        Select-Object DeviceID,
            VolumeName,
            @{Name = "SizeGB"; Expression = {[math]::Round($_.Size / 1GB, 2)}},
            @{Name = "FreeGB"; Expression = {[math]::Round($_.FreeSpace / 1GB, 2)}},
            @{Name = "FreePercent"; Expression = {
                if ($_.Size -gt 0) {
                    [math]::Round(($_.FreeSpace / $_.Size) * 100, 2)
                }
            }}
}

Add-Section "NETWORK CONFIGURATION"

Add-CommandOutput {
    Get-NetIPConfiguration |
        Select-Object InterfaceAlias,
            InterfaceDescription,
            IPv4Address,
            IPv4DefaultGateway,
            DNSServer
}

Add-CommandOutput {
    Get-NetAdapter |
        Select-Object Name,
            InterfaceDescription,
            Status,
            LinkSpeed,
            MacAddress
}

Add-Section "NETWORK CONNECTIVITY TESTS"

Add-CommandOutput {
    Test-NetConnection "1.1.1.1" -Port 443
}

Add-CommandOutput {
    Test-NetConnection "login.microsoftonline.com" -Port 443
}

Add-CommandOutput {
    Resolve-DnsName "www.microsoft.com"
}

Add-Section "INSTALLED PRINTERS"

Add-CommandOutput {
    Get-Printer |
        Select-Object Name,
            DriverName,
            PortName,
            PrinterStatus,
            Default
}

Add-Section "BITLOCKER STATUS"

Add-CommandOutput {
    if (Get-Command Get-BitLockerVolume -ErrorAction SilentlyContinue) {
        Get-BitLockerVolume |
            Select-Object MountPoint,
                VolumeStatus,
                ProtectionStatus,
                EncryptionPercentage,
                EncryptionMethod
    }
    else {
        "BitLocker PowerShell commands are not available."
    }
}

Add-Section "PENDING RESTART CHECK"

Add-CommandOutput {
    $restartReasons = New-Object System.Collections.Generic.List[string]

    if (Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootPending") {
        $restartReasons.Add("Component Based Servicing")
    }

    if (Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired") {
        $restartReasons.Add("Windows Update")
    }

    $sessionManagerPath = "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager"

    $pendingFileRename = Get-ItemProperty `
        -Path $sessionManagerPath `
        -Name PendingFileRenameOperations `
        -ErrorAction SilentlyContinue

    if ($pendingFileRename) {
        $restartReasons.Add("Pending file rename operations")
    }

    if ($restartReasons.Count -gt 0) {
        [PSCustomObject]@{
            RestartPending = $true
            Reasons        = $restartReasons -join ", "
        }
    }
    else {
        [PSCustomObject]@{
            RestartPending = $false
            Reasons        = "None detected"
        }
    }
}

Add-Section "IMPORTANT SERVICES"

Add-CommandOutput {
    $serviceNames = @(
        "Spooler",
        "wuauserv",
        "BITS",
        "Winmgmt",
        "EventLog",
        "Dnscache"
    )

    Get-Service -Name $serviceNames -ErrorAction SilentlyContinue |
        Select-Object Name,
            DisplayName,
            Status,
            StartType
}

Add-Section "TOP PROCESSES BY MEMORY"

Add-CommandOutput {
    Get-Process |
        Sort-Object WorkingSet64 -Descending |
        Select-Object -First 15 `
            ProcessName,
            Id,
            CPU,
            @{Name = "MemoryMB"; Expression = {
                [math]::Round($_.WorkingSet64 / 1MB, 2)
            }}
}

Add-Section "RECENT SYSTEM ERRORS"

Add-CommandOutput {
    Get-WinEvent `
        -FilterHashtable @{
            LogName   = "System"
            Level     = 1, 2
            StartTime = (Get-Date).AddDays(-2)
        } `
        -MaxEvents 30 `
        -ErrorAction SilentlyContinue |
        Select-Object TimeCreated,
            ProviderName,
            Id,
            LevelDisplayName,
            Message
}

Add-Section "RECENT APPLICATION ERRORS"

Add-CommandOutput {
    Get-WinEvent `
        -FilterHashtable @{
            LogName   = "Application"
            Level     = 1, 2
            StartTime = (Get-Date).AddDays(-2)
        } `
        -MaxEvents 30 `
        -ErrorAction SilentlyContinue |
        Select-Object TimeCreated,
            ProviderName,
            Id,
            LevelDisplayName,
            Message
}

Write-Host ""
Write-Host "Diagnostic report completed." -ForegroundColor Green
Write-Host "Report saved to:" -ForegroundColor Cyan
Write-Host $reportFile -ForegroundColor White

Start-Process notepad.exe -ArgumentList "`"$reportFile`""
Read-Host "Press Enter to close"

Example ITAppsPanel commands

Launch a script using Windows PowerShell:

powershell.exe -NoProfile -ExecutionPolicy Bypass -File "C:\ITSupport\Scripts\Repair-Network.ps1"

Launch the diagnostics collector:

powershell.exe -NoProfile -ExecutionPolicy Bypass -File "C:\ITSupport\Scripts\Collect-SupportDiagnostics.ps1"

Force the 64-bit Windows PowerShell executable on 64-bit Windows:

%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -ExecutionPolicy Bypass -File "C:\ITSupport\Scripts\Collect-SupportDiagnostics.ps1"

Suggested operational checklist

  1. Choose a repetitive, low-risk troubleshooting scenario.
  2. Write the script and document every action it performs.
  3. Add logging, error handling, and a user confirmation step.
  4. Test under standard-user and administrator contexts.
  5. Review with security, compliance, and service-delivery owners.
  6. Pilot with internal staff or a limited customer group.
  7. Publish the approved script through ITAppsPanel.
  8. Monitor outcomes, failures, and support-ticket reduction.
  9. Version, sign, and periodically review the script.
Final reminder

This document is a workshop handout, not a production runbook. The examples may be incomplete, unsuitable, or harmful in a particular environment. Independent review, testing, authorization, and adaptation are mandatory. Use is entirely at the implementer’s own risk.

Webinar take-away document for educational discussion and internal planning.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article