2
votes

I am new to powershell. I am trying to backup a sharepoint site using a stsadm command but for some reason I keeps on giving me some error.

Here is what I am doing:
PS C:\Users\Administrator> Stsadm –o backup –url >http://server< name:port -filename path\filename to be used for the backup file

Here is the error I am getting:
The term 'stsadm' is not recognized as the name of the cmdlet, function, script file, or operable program. Check the spelling of the name, or path was included, verify that the path is correct and try again,
At line:1 char:7
+ stsadm <<<< stsadm –o backup –url >http://server< name:port -filename path\filename to be used for the backup file
+CategoryInfo : ObjectNotFound: [], CommandNotFoundException
+FullyQualifiedErrorID : CommandNotFoundException

2
Could you please enter a more specific comment? There must be dozens of questions here in which "stsadm not working".John Saunders
Sorry for the confusion John. But I am trying to do a site backup and stsadm is something not working for me. So this probably was the best way to put my comment. Sorry again if this is too confusing.Andres Morales
How about "stsadm is not recognized", since it probably doesn't matter which command you execute?John Saunders
It was a case of user permissions, though the error is misleading us, Launch command prompt with wss sysadmin credentials and run the same command from command prompt, it worked for meSundara Prabu

2 Answers

5
votes

Stsadm is not a powershell script, it is an executable located in C:\Program Files\Common Files\Microsoft Shared\web server extensions\12 or 14 'hive'.

Normally you would refrain from calling stsadm when running powershell as it is effectively deprecated in SharePoint 2010.

You can however change directory to locate the executable and call it if you wish.

Here is a list of stsadm equivalents in powershell.

1
votes

check this blog post => Backup and Restore SharePoint 2010 Site Collection with PowerShell: http://www.bradleyschacht.com/backup-and-restore-sharepoint-2010-site-collection-with-powershell/ Perhaps, it is what you are looking for