0

I have a WebApp called Brett - WebApp that I'm trying to backup using PowerShell and for some reason, it keeps complaining that it can't find that item. I've created a folder under my C:/ drive called Backup and I've specified that location in my script, along with the name of my WebApp (using double quotations) but it keeps saying that "Backup-SPFarm : Item Brett - WebApp not found". I've gone into my SharePoint Central Admin page and have confirmed that I do indeed have a WebApp called Brett - WebApp so I'm not entirely sure why it can't find it. I have the SharePoint 2013 Management Shell open as well and have closed the Central Admin internet explorer page while trying to perform the backup just in case it decides to lock any required files during the backup process. This is the full PowerShell script that I'm using:

Backup-SPFarm -Directory C:\Backup -BackupMethod Full -Item “Brett – WebApp” -Verbose

Has anyone run into this issue as well or have any tips on how to fix it? I've done some research on the web and can't find anything specific that relates to this issue. Another person wasn't using the double quotations so that was why it wasn't working for them but I'm using double quotations so I'm a bit confused here. Any help would be greatly appreciated. Thanks!

EDIT: I forgot to mention that I completed a successful backup of that same WebApp using the Central Admin page yesterday and everything worked perfectly. It's just refusing to backup in PowerShell for some reason.

4
  • 1
    A couple of ideas: 1) The backup from Central Admin might write a log-file to the backup-folder. In the log, you'll find the correct name. 2) It could be that the "-" sign between "Brett" and "WebApp" you use is not the correct one. 3) Run a "Get-SPWebApplication" to check the correct name in the PowerShell window. Maybe you need to store the result in a variable and check for the "title" property. Let me know if you need further help. Then I'll check quickly on my test farm. – engineerer Nov 24 '20 at 17:59
  • Thanks for the info! I checked the log file and it shows just a regular dash between Brett and WebApp (Brett - WebApp) so I tried running the Get-SPWebApplication cmdlet and it says it isn't a recognized cmdlet. I tried placing the WebApp name in a variable but it keeps saying the cmdlet isn't recognized. EDIT: I realized that it was because I forgot to execute the add-pssnapin microsoft.sharepoint.powershell command. – Pacman12312 Nov 24 '20 at 19:08
  • Very strange, I just restarted both my servers and tried again from scratch and it worked this time. Thanks for providing your input! – Pacman12312 Nov 24 '20 at 19:13
  • Great that it works now! – engineerer Nov 24 '20 at 19:17
0

After doing some investigating, pointed out by engineerer, I tried the same steps again from scratch after restarting both server VM's and it worked this time.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.