We're having about the same problem that described in this topic :
http://www.ks-soft.net/cgi-bin/phpBB/vi ... powershell
HM v9.58 running on a Windows Server 2008 R2
RMA v4.62 running on a Windows Server 2008 R2
When executing Powershell script locally on the remote server, it's working correctly and displaying correct result.
When executing from HM as a Shell Script with command line :
cmd /c powershell %Params% , the result is not the same (and not the good one).
Adding parameter SScript_UseWindowsPipe=1 in [Misc] section of rma.ini (and restarting rma) didn't work for us. We also tried this parameter in hostmon.ini (and restarted HM) but no more success.
Also, we don't get the complete reply in HM, for example :
in the script :
return "ScriptRes:Warning:Verifier que le role et les fonctionnalites 'Windows Server Backup' sont bien installees sur ce serveur"
in HM reply : Verifier que le role et les fonctionnalites 'Windows Server B
I don't know if this is related but i find it very strange.
here is the script :
Code: Select all
# Script pour voir le statut du job Windows Server Backup
# Launch script with force option
#Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser -force
# Import du module Server Manager
Import-Module ServerManager
# Si la version de Windows est 2008 ou 2012
if ([Environment]::OSVersion.version.major -eq 6)
{
# Windows 2012
if ([Environment]::OSVersion.version.minor -gt 1)
{
$WSBFeatureBackup = Get-WindowsFeature | Where-Object {$_.Name -eq "Windows-Server-Backup"}
$WSBFeatureTools = Get-WindowsFeature | Where-Object {$_.Name -eq "Migration"}
$Winver = "2012"
}
# Windows 2008
else
{
$WSBFeatureBackup = Get-WindowsFeature | Where-Object {$_.Name -eq "Backup"}
$WSBFeatureTools = Get-WindowsFeature | Where-Object {$_.Name -eq "Backup-Tools"}
$Winver = "2008"
}
# Vérification que les fonctionnalités sont bien installées
If ($WSBFeatureBackup.Installed -and $WSBFeatureTools.Installed -eq "True")
{
# Si Windows 2008
if ($Winver -eq "2008")
{
# Vérification que le module Windows.ServerBackup est importé
if ( (Get-PSSnapin -Name Windows.ServerBackup -ErrorAction SilentlyContinue) -eq $null )
{
# Import du module Windows.ServerBackup
Add-PsSnapin Windows.ServerBackup
}
}
# Vérification de la présence d'un job de sauvegarde
$WSBVerifJob = (Get-WBSummary).NumberOfVersions
if ($WSBVerifJob -ne 0)
{
# Vérification du statut de la sauvegarde
$BackupResult = (Get-WBSummary).LastBackupResultHR
if ($BackupResult -eq 0)
{
return "ScriptRes:Ok:Sauvegarde NAS OK"
}
else
{
return "ScriptRes:Bad:Erreur Sauvegarde NAS"
}
}
else
{
return "ScriptRes:Warning:Verifier qu'un job de sauvegarde est bien présent sur ce serveur"
}
}
else
{
return "ScriptRes:Warning:Verifier que le role et les fonctionnalites 'Windows Server Backup' sont bien installees sur ce serveur"
}
}
else
{
return "ScriptRes:Warning:Ce script n'a pas ete teste pour cette version de Windows"
}
Thanks in advance for your help