Run remote repadmin without server name

This commit is contained in:
2026-01-29 12:04:18 +13:00
parent d728765206
commit dd814d9401

View File

@@ -274,6 +274,9 @@ function Invoke-Replication {
if ($remoteCmd -match "(?i)\brepadmin\b" -and $remoteCmd -match "(?i)\bsyncall\b") { if ($remoteCmd -match "(?i)\brepadmin\b" -and $remoteCmd -match "(?i)\bsyncall\b") {
$remoteCmd = [regex]::Replace($remoteCmd, "(?i)\brepadmin\s+/syncall\s+\S+", "repadmin /syncall") $remoteCmd = [regex]::Replace($remoteCmd, "(?i)\brepadmin\s+/syncall\s+\S+", "repadmin /syncall")
} }
$remoteCmd = [regex]::Replace($remoteCmd, "(?i)\brepadmin\s+/syncall\b", "repadmin /syncall")
$remoteCmd = $remoteCmd.Replace("/AdeP", "/AedP")
$remoteCmd = [regex]::Replace($remoteCmd, "\s{2,}", " ").Trim()
if ([string]::IsNullOrWhiteSpace($remoteCmd)) { if ([string]::IsNullOrWhiteSpace($remoteCmd)) {
& $Log "Replication skipped: empty command for $server." & $Log "Replication skipped: empty command for $server."
continue continue
@@ -638,7 +641,7 @@ $y += 70 + $gap
Add-Label "Replication command ({server} optional)" $xLabel $y $labelWidth $rowHeight Add-Label "Replication command ({server} optional)" $xLabel $y $labelWidth $rowHeight
$replicationCmdBox = Add-TextBox $xInput $y $inputWidth $rowHeight $false $replicationCmdBox = Add-TextBox $xInput $y $inputWidth $rowHeight $false
$replicationCmdBox.Text = "repadmin /syncall {server} /AdeP" $replicationCmdBox.Text = "repadmin /syncall /AedP"
$y += $rowHeight + $gap $y += $rowHeight + $gap
Add-Label "Replication wait (seconds)" $xLabel $y $labelWidth $rowHeight Add-Label "Replication wait (seconds)" $xLabel $y $labelWidth $rowHeight