# Manually trigger AD2 sync script to test CRLF preservation

$Username = "INTRANET\sysadmin"
$Password = ConvertTo-SecureString "Paper123!@#" -AsPlainText -Force
$Cred = New-Object System.Management.Automation.PSCredential($Username, $Password)

Write-Host "[INFO] Triggering sync on AD2..."

$SyncResult = Invoke-Command -ComputerName 192.168.0.6 -Credential $Cred -ScriptBlock {
    # Run the sync script
    & 'C:\Shares\test\scripts\Sync-FromNAS.ps1'
}

Write-Host "[INFO] Sync output:"
$SyncResult | ForEach-Object { Write-Host $_ }

Write-Host ""
Write-Host "[INFO] Sync triggered. Checking results..."
