Auteur de questions
Backup component Batterie de serveurs could not be found

Discussion générale
-
Bonjour,
Disposant d'un script de sauvegarde de la ferme, la batterie de serveur n'est plus disponible donc incapable d'effectuer ses sauvegardes automatiques.
Ce n'est pas un soucis d'espace disque ni de configuration du script (il n'a pas été modifié).
Je ne vois aucune autre pistes de recherche pouvant m'aider à résoudre ce problème de sauvegarde, qui se fait automatiquement.
Auriez-vous une idée s'il vous plaît ?
- Type modifié Gokan OzcifciMVP lundi 17 février 2014 07:43
Toutes les réponses
-
-
- Quel sont les logs d'erreurs du script ?
FarmBackup : Cannot validate argument on parameter 'bckMethod'. The argument "" does not belong to the set "Full,Differ
ential" specified by the ValidateSet attribute. Supply an argument that is in the set and then try the command again.
At S:\Admin\Scripts\Backup-spfarm.ps1:162 char:22
+ FarmBackup -bckMethod <<<< $script:args[0]
+ CategoryInfo : InvalidData: (:) [FarmBackup], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationError,FarmBackup- Est ce que tu pourrais nous transmettre le code du script en question ?
cf pj
#script variables config #MAIL --> paramètre Notification Mail $emailfrom = "xxxxxx" $emailto = "xxxxxxxx" $smtpserver = "xxxxxxx" $subject = "xxxxxxx" $ErrorMessage = "" #MAIL $backupDirectory = "\\nom du srv\SPSBackups$\Farm_Backup" $spbrtoc = "\\nom du srv\SPSBackups$\Farm_Backup\spbrtoc.xml" $cleanOldBackup = $true $retentionFullBackupNumber = 3 #end script variables config function FarmBackup { Param( [Parameter(Mandatory=$true,ValueFromPipeline=$false)] [ValidateSet("Full","Differential")] [String] $bckMethod ) process { try { #load SharePoint PowerShell Components Add-PSSnapin Microsoft.SharePoint.PowerShell –ErrorAction SilentlyContinue Backup-SPFarm -Directory \\nom du srv\SPSBackups$\Farm_Backup -BackupMethod $bckMethod if (!$?) { $ErrorMessage = $error[0] SendReport $ErrorMessage } } catch { $ErrorMessage = $error[0] SendReport $ErrorMessage } } } function CleanFarmBackup { #load SharePoint PowerShell Components Add-PSSnapin Microsoft.SharePoint.PowerShell –ErrorAction SilentlyContinue # Import the Sharepoint backup report xml file [xml]$sp = gc $spbrtoc # Find the FULL backups in spbrtoc.xml $fullBck = $sp.SPBackupRestoreHistory.SPHistoryObject | ?{$_.SPBackupMethod -eq "Full"} if ($fullBck.count -gt $retentionFullBackupNumber) { #get All Backup Before the date of the last Backup $date = $fullBck[$retentionFullBackupNumber].SPStartTime $old = $sp.SPBackupRestoreHistory.SPHistoryObject | ?{ $_.SPStartTime -le ($date) } if ($old -eq $Null) { break; } # Delete the old backups from the Sharepoint backup report xml file $old | % { $sp.SPBackupRestoreHistory.RemoveChild($_) } # Delete the physical folders in which the old backups were located $old | % { Remove-Item $_.SPBackupDirectory -Recurse } #Find Differential Backup rattached to the more recent delete backup $continue = $true While ($continue) { $lastChild = $sp.SPBackupRestoreHistory.LastChild #Delete found differential backup, because the previous full backup was deleted if ($lastChild.SPBackupMethod -eq "Differential") { # Delete the old backups from the Sharepoint backup report xml file $sp.SPBackupRestoreHistory.RemoveChild($lastChild) # Delete the physical folders in which the old backups were located Remove-Item $lastChild.SPBackupDirectory -Recurse $continue = $true } else { $continue = $false } } # Save the new Sharepoint backup report xml file $sp.Save($spbrtoc) } } function SendReport { param([string]$htmlContent) if ($smtpserver -and $emailfrom -and $emailto -and $subject) { $smtp = New-Object Net.Mail.SmtpClient($smtpserver) if ($emailto.contains(";")) { $emailTo1 = $emailto.split(";")[0] } else { $emailTo1 = $emailto } $msg = New-object Net.Mail.MailMessage($emailfrom, $emailTo1, $subject, "") foreach ($dest in $emailto.split(";")) { if ($dest -ne $emailTo1) { $msg.To.add($dest); } } $msg.BodyEncoding = New-Object System.Text.utf8encoding $EmailBody = $htmlContent $msg.Body = $EmailBody $msg.IsBodyHtml = $true $smtp.send($msg) } } function GenerateHTMLFile { [xml]$sp = gc $spbrtoc $htmlContent = "<html><head></head><body>" $htmlContent = $htmlContent + "<tr><td>Message:</td><td>"+ $ErrorMessage +"</td></tr><br/><br/>" $htmlContent = $htmlContent + "<u>nom du srv SPS 2010 BACKUP HISTORY :</u><br/><br/>" $htmlContent = $htmlContent + "<table style='border-collapse: collapse' >" $htmlContent = $htmlContent + "<tr><th style='border-bottom:2px solid #6678b1;margin-right:15px;margin-left:15px;'>Backup Type</th><th style='border-bottom:2px solid #6678b1;margin-right:15px;margin-left:15px;'>Backup Method</th><th style='border-bottom:2px solid #6678b1;margin-right:40px;margin-left:40px;'>StartTime</th><th style='border-bottom:2px solid #6678b1;margin-right:15px;margin-left:15px;'>FinishTime</th><th style='border-bottom:2px solid #6678b1;margin-right:15px;margin-left:15px;'>WarningCount</th><th style='border-bottom:2px solid #6678b1;margin-right:15px;margin-left:15px;'>ErrorCount</th><th style='border-bottom:2px solid #6678b1;margin-right:15px;margin-left:15px;'>BackupSize</th></tr>" for ($cpt = 0 ; $cpt -lt $sp.SPBackupRestoreHistory.SPHistoryObject.count ; $cpt++) { $colItems = (Get-ChildItem $sp.SPBackupRestoreHistory.SPHistoryObject[$cpt].SPBackupDirectory -recurse | Measure-Object -property length -sum) $backupSize = "{0:N2}" -f ($colItems.sum / 1MB) + " MB" $htmlContent = $htmlContent + "<tr align=center style='background-color:#81F781;'>" $htmlContent = $htmlContent + "<td style='border-bottom:2px solid white;'>" + $sp.SPBackupRestoreHistory.SPHistoryObject[$cpt].SPTopComponent + "</td>" + "<td style='border-bottom:2px solid white;'>" + $sp.SPBackupRestoreHistory.SPHistoryObject[$cpt].SPBackupMethod + "</td>" + "<td style='border-bottom:2px solid white;'>" + ([datetime]$sp.SPBackupRestoreHistory.SPHistoryObject[$cpt].SPStartTime).tolocaltime() + "</td>" + "<td style='border-bottom:2px solid white;'>" + ([datetime]$sp.SPBackupRestoreHistory.SPHistoryObject[$cpt].SPFinishTime).tolocaltime() + "</td>" + "<td style='border-bottom:2px solid white;'>" + $sp.SPBackupRestoreHistory.SPHistoryObject[$cpt].SPWarningCount + "</td>" + "<td style='border-bottom:2px solid white;'>" + $sp.SPBackupRestoreHistory.SPHistoryObject[$cpt].SPErrorCount + "</td>" + "<td style='border-bottom:2px solid white;'>" + $backupSize + "</td>" $htmlContent = $htmlContent + "</tr>" } $htmlContent = $htmlContent + "</table>" $htmlContent = $htmlContent + "</body></html>" return $htmlContent } FarmBackup -bckMethod $script:args[0] if ($cleanOldBackup) { CleanFarmBackup } $content = GenerateHTMLFile SendReport $content
- Sur quel serveur est exécuté le script (frontal, applicatif) ?
il est exécuté sur le serveur applicatif, il a toujours fonctionné (presque 2 ans) cela dit dans la notification par mail de l'historique de sauvegarde, il apparait le message mis en objet de la question.
-
-
-
-
-
-
-
-
Voici le résultat avec l'argument "Differential" et "Full" :
Backup-SPFarm : Backup component Batterie de serveurs could not be found. At line:1 char:14 + Backup-SPFarm <<<< -Directory \\nom du srv\SPSBackups$\Farm_Backup -BackupMethod "Differential" + CategoryInfo : InvalidData: (Microsoft.Share...mdletBackupFarm:SPCmdletBackupFarm) [Backup-SPFarm], SPE xception + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletBackupFarm
Le message d'erreur qui préoccupe est bien celui-là : Backup component Batterie de serveurs could not be found.
Par contre le lancement de la sauvegarde via la console d'administration fonctionne quand elle est faite manuellement....- Modifié Younes BOUZBIB mercredi 12 février 2014 16:35
-
OK, cette erreur est déjà plus ciblée.
Plusieurs vérifications à effectuer :
- Comme mentionné par Olivier, est ce que tu as essayé de lancer le script / taches avec une élévation de privilège.
- Est ce que ton compte à les droits admins sur le serveur ?
- Est ce que ton compte à es droits sur la base de configuration ?
http://www.sharepointassist.com/2010/01/29/the-local-farm-is-not-accessible-cmdlets-with-featuredependencyid-are-not-registered/comment-page-1/#comment-1566
(Tu peux essayer de lancer le début du Configuration Wizard pour voir si ton compte à les droits )
Julian GILBERT
-
- Comme mentionné par Olivier, est ce que tu as essayé de lancer le script / taches avec une élévation de privilège.
Oui, les 2 tâches sont bien configurées avec l'option "Run with highest privileges"
- Est ce que ton compte à les droits admins sur le serveur ?
Le compte de service associé à la batterie de serveurs est bien celui configuré dans les tâches planifiées
- Est ce que ton compte à es droits sur la base de configuration ?
Il dispose effectivement des droits sur la base
-