$password = ConvertTo-SecureString 'Paper123!@#' -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential('INTRANET\sysadmin', $password)

Write-Host "[OK] Searching for database folders on AD2..."
Invoke-Command -ComputerName 192.168.0.6 -Credential $cred -ScriptBlock {
    Get-ChildItem C:\ -Directory | Where-Object Name -like '*database*' | Select-Object FullName
}

Write-Host "`n[OK] Checking Sync-FromNAS.ps1 for database references..."
Invoke-Command -ComputerName 192.168.0.6 -Credential $cred -ScriptBlock {
    $content = Get-Content C:\Shares\test\scripts\Sync-FromNAS.ps1 -Raw
    $content | Select-String -Pattern "(database|sql|connection|sqlite|mysql|postgres)" -AllMatches -Context 5,5 | Select-Object -First 10
}
