PowerShell scripts are not working properly after upgrading to AppAssure Core build 5.4.x. Specifically, if the PS script references the "Get-ProtectedServers" method.
NOTE: Quest support of PowerShell scripting for AppAssure: https://support.quest.com/appassure/kb/119405
This is how it looks in 5.4.x; it needs to be combined with an object returned by Get-RecoveryPoints.
For example:
# (Get-ProtectedServers)[0] | fl
DisplayName : w2012-0
Version : 5.4.1.77
Status : Online
NextSnapshot : 8/27/2014 11:00:00 AM
IsPaused : False
HasEncryptionKey : False
RepositoryName : Repository 1
# Get-RecoveryPoints -ProtectedServer w2012-0 -Number 1
Number State Display Name
------ ----- ------------
37 White W2012-0 Wed, 27 Aug 2014 14:00:05 GMT (Volume Labeled 'System Reserved') E:\ C:\ ...
WORKAROUND:
Modify your scripts to use the Get-RecoveryPoints method.
EXAMPLE:
param ($file="D:\AppAssureScripts\LastRP.txt")
$reportdate=Get-date
$title = "Newest Recovery Points as of $($reportdate.ToString("MMMM dd yyyy"))"
$uline = "-" * $title.length
Write-Host "`r`n`r`n$title`r`n$uline"
$agents = get-protectedservers | sort-object -property displayname
$RPs = @()
foreach ($agent in $agents){
Write-host "Getting info for " -f Blue
$r = get-recoverypoints -protectedserver ($agent.displayname) -number l1 #-ErrorAction SilentlyContinue
$z = $r | Select-Object -property AgentHostName,DateTimeStamp,Number,AgentVolumes
$line=[pscustomobject]@{ServerName=$agent.displayName;Status=$agent.status;Number=$z.Number; AgentVolumes=$z.AgentVolumes;LatestRecoveryPoint=($z.DateTimeStamp).tolocaltime()}
$RPs +=$line
}
write-output $RPs
$table = $RPs | ft ServerName, Status, LatestRecoveryPoint, Number, AgentVolumes -AutoSize -Wrap | out-string
$table
© 2023 Quest Software Inc. ALL RIGHTS RESERVED. Feedback Terms of Use Privacy