This is a “reprint” of an article originally published on a private wiki not open to the public by me in July 2009.
Add & Deploy
To install a SharePoint solution called solution.wsp from C:\MMU Web Parts\ on your SharePoint farm (you should be able to run these commands from any web server in the farm):
Add:
stsadm -o addsolution -filename "C:\MMU Web Parts\solution.wsp"
Now deploy it to the web application of your SharePoint site:
Deploy:
stsadm -o deploysolution -name "solution.wsp" -url "https://my.mmu.ac.uk" -immediate [-allowgacdeployment]
Enumerate current solutions
If you’d just like to see which solutions are installed on your SharePoint server farm:
stsadm -o enumsolutions
But this spits out a lot of XML that’s very difficult to read on the command line (or at all). Here’s a Perl script to run to get enumsolutions without all the surrounding flim-flam:
@o=split /</,`stsadm -o enumsolutions`;
while(<@o>){
chop;
print qq[$_\n] if /^Name=.*wsp/;
}
or on the Windows cmd line:
perl -e "@o=split /</,`stsadm -o enumsolutions`; while(<@o>){chop;print qq[$_\n] if /^Name=.*wsp/;}"
Retract & Delete
To uninstall a SharePoint solution from your farm run both of these commands:
stsadm -o retractsolution -name "solution.wsp" -url "https://my.mmu.ac.uk" -immediate
stsadm -o deletesolution -name "solution.wsp"
Lastly, here’s an improved Perl one-liner for taming the tidal wave of XML output from enumsolutions.