[29.04.2024 13:58:50.790] <50> Info (3) [SureBackup] [JOBNAME] [ScriptTests] Process is starting with the following start info:
[29.04.2024 13:58:50.790] <50> Info (3) [SureBackup] [JOBNAME] [ScriptTests] > WorkingDirectory = C:\Program Files\Veeam\Backup and Replication\Backup
[29.04.2024 13:58:50.790] <50> Info (3) [SureBackup] [JOBNAME] [ScriptTests] > FileName = C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe
[29.04.2024 14:00:05.905] <43> Info (3) [SureBackup] [JOBNAME] [ScriptTests] [Console] [masqueradeIP] Connecting to remote server <masqueradeIP> failed with the following error message : Access is denied.
[29.04.2024 14:00:05.905] <43> Info (3) [SureBackup] [JOBNAME] [ScriptTests] [Console] For more information, see the about_Remote_Troubleshooting Help topic.
[29.04.2024 14:00:05.905] <43> Info (3) [SureBackup] [JOBNAME] [ScriptTests] [Console] At C:\ps\powershellscriptname.ps1:4 char:5
[29.04.2024 14:00:05.905] <43> Info (3) [SureBackup] [JOBNAME] [ScriptTests] [Console] + $ReturnCode = Invoke-Command -Credential $CredObject -Computernam ...
[29.04.2024 14:00:05.905] <43> Info (3) [SureBackup] [JOBNAME] [ScriptTests] [Console] + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[29.04.2024 14:00:05.905] <43> Info (3) [SureBackup] [JOBNAME] [ScriptTests] [Console] + CategoryInfo : OpenError: (masqueradeIP:String) [], PSRemotingTransportException
[29.04.2024 14:00:05.905] <43> Info (3) [SureBackup] [JOBNAME] [ScriptTests] [Console] + FullyQualifiedErrorId : AccessDenied,PSSessionStateBroken
[29.04.2024 14:00:05.937] <50> Info (3) [SureBackup] [JOBNAME] [ScriptTests] Process has been finished:
[29.04.2024 14:00:05.937] <50> Info (3) [SureBackup] [JOBNAME] [ScriptTests] > ProcessId = 37744
[29.04.2024 14:00:05.937] <50> Info (3) [SureBackup] [JOBNAME] [ScriptTests] > StartTime = 4/29/2024 1:58:50 PM
[29.04.2024 14:00:05.937] <50> Info (3) [SureBackup] [JOBNAME] [ScriptTests] > ExitTime = 4/29/2024 2:00:05 PM
[29.04.2024 14:00:05.937] <50> Info (3) [SureBackup] [JOBNAME] [ScriptTests] > TotalProcessorTime = 00:00:00.7031250
[29.04.2024 14:00:05.937] <50> Info (3) [SureBackup] [JOBNAME] [ScriptTests] > ExitCode = 1
I have also made sure the Windows Firewall is being disabled as part of the SB job and I added the masquerade IP address explicitly as a TrustedHost.
The PowerShell script being run is as follows:
Code: Select all
Param($TestVmIP)
$ReturnCode = 1
$CredObject = Import-Clixml -Path C:\ps\CredObject.xml
$ReturnCode = Invoke-Command -Credential $CredObject -Computername $TestVmIP -ErrorAction Stop -ScriptBlock{
# create an array of paths to search through
$folders = 'E:\Foldername\*'
# create an array of file names to look for
$files = 'budget2024.xlsx', 'exec-contacts.docx', 'pw.txt', 'payroll.docx'
Get-ChildItem -Path $folders -Include $files -File |
Get-FileHash -Algorithm MD5 |
Export-Csv -Path 'C:\ps\newhashes.csv' -UseCulture -NoTypeInformation
$oldHashes = Import-Csv "C:\ps\hashes.csv"
$newHashes = Import-Csv "C:\ps\newhashes.csv"
$compare = Compare-Object $oldHashes $newHashes -Property Hash, Path
if ($compare.SideIndicator -eq "<=" -or $compare.SideIndicator -eq "=>"){
Exit 1
}
else{
Exit 0
}
}
exit $ReturnCode
-Adam