$password = ConvertTo-SecureString 'Paper123!@#' -AsPlainText -Force $cred = New-Object System.Management.Automation.PSCredential('INTRANET\sysadmin', $password) Write-Host "=== Checking AD2 BAT files ===" -ForegroundColor Cyan Invoke-Command -ComputerName 192.168.0.6 -Credential $cred -ScriptBlock { $files = @('CHECKUPD.BAT', 'CTONW.BAT', 'DEPLOY.BAT', 'UPDATE.BAT') foreach ($file in $files) { $path = "C:\Shares\test\COMMON\ProdSW\$file" if (Test-Path $path) { $item = Get-Item $path Write-Host "$file - Last Modified: $($item.LastWriteTime)" -ForegroundColor Green } else { Write-Host "$file - NOT FOUND" -ForegroundColor Red } } } Write-Host "" Write-Host "=== Checking NAS BAT files ===" -ForegroundColor Cyan # Connect to NAS via SSH and check files