We are in the process of rolling out an extranet for some of our partners using WSS 3.0 as the platform. We already use it internally for a variety of things, and we are using the following powershell script to backup the server:
param(
$url="http://localhost",
$backupFolder="c:\"
)
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
$site= new-Object Microsoft.SharePoint.SPSite($url)
$names=$site.WebApplication.Sites.Names
foreach ($name in $names)
{
$n2 = ""
if ($name.Length -eq 0)
{ $n2="ROOT" }
else
{ $n2 = $name }
$tmp=$n2.Replace("/", "_") + ".sbk"
$saveas = ""
if ($backupFolder.Length -eq 0)
{ $saveas = $tmp }
else
{ $saveas = join-path -path $backupFolder -childPath $tmp }
$site.WebApplication.Sites.Backup($name, $saveas, "true")
write-host "$n2 backed up to $saveas."
}
This script works perfectly on the current installation running as our domain backup user.
On the new box, it fails when ran as the backup user--claiming "The web application located at http://extranet/" could not be found. That url does, in fact, work so I'm fairly certain it isn't anything that dumb and rather is some permissions issue. Especially because, when executed from my security context, the script works perfectly.
I have tried making the backup user a farm owner, as well as added him to the various site collection admin groups on the extranet. The one major difference between the extranet and the intranet server is that the extranet has an alternative access mapping (for https://xnet.example.com) and also uses forms authentication for that mapping. Anyhow, what permissions (or other voodoo) do I need to setup to get this script to work properly?
im a bit fuzzy on this, as its been a while and i dont have the server in question in front of me, but i think i had a similar problem.
we had a sharepoint services site that absolutely would not back up at all no matter what i did - until i created a share with write access for the guest user (i think).
this is really a terrible answer, and ill update it later with more detail.
UPDATE: mine is also implemented using stsadmin, per a commenter above. i did not enumerate any specific sites or hosts other than the machine that is hosting sharepoint itself.