The term 'Get-SPBackupCatalog' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name
-
29-09-2020 - |
Domanda
i am trying to run the following script using windows power shell ISE:-
Add-PSSnapin Microsoft.SharePoint.PowerShell
$cat = Get-SPBackupCatalog \\T01\Back
Backup-SPFarm -Directory \\T01\Back -BackupMethod Full -BackupThreads 10 -Force
$cat.Refresh()
$cat | Remove-SPBackupCatalog -RetainCount 1 -Confirm:$false
$cat.Refresh()
$cat | Send-SPBackupStatus -Recipients "********"
but i got the following error:-
Get-SPBackupCatalog : The term 'Get-SPBackupCatalog' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:2 char:8 + $cat = Get-SPBackupCatalog \T01\Back + ~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (Get-SPBackupCatalog:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException
can anyone advice please?
Soluzione
I can't see that you have run the SharePointBAC.ps1
in your script, which is downloaded from the Codeplex page SharePoint Backup Augmentation Cmdlets. The scripts
- Get-SPBackupCatalog
- Set-SPBackupCatalog
- Remove-SPBackupCatalog
- Export-SPBackupCatalog
is not out-of-the-box native cmdlets in SharePoint Management Shell or PowerShell ISE with the reference of Add-PSSnapin Microsoft.SharePoint.PowerShell
.
Altri suggerimenti
That is not an official SP commandlet
You can download it on codeplex https://sharepointbac.codeplex.com/
After downloading you install it by running the "SharePointBAC.ps1" included in the download Further Documentation