The magic undocumented SharePoint 2007 command

Looking for a quick way to ruin your evening?  One quick simple command can quickly turn that nice looking enterprise portal into a big pile of nothingness.  I guess on the brighter side of things it provides a nice opportunity to test out that disaster recovery plan you created.

So what is this command?  It is the undocumented SharePoint 2007 stsadm –o uninstall command.   Once quick hit of the enter key and you can kiss all of your hard work goodbye.    Ok, ok… so it doesn’t delete everything but it does make a nice mess.

The interesting thing here is that stsadm does not list this as a valid command but if you type it and hit enter it will remove SharePoint from the default virtual server at port 80.  This happens without any confirmation prompt to protect you from accidentally trashing your environment.  The good news is that your content databases are not damaged during this.

It looks like this command is left over from SharePoint 2003 and is listed in SPS2003 reference materials on TechNet.

Having this command still available in SharePoint 2007 is extremely dangerous since developers and SharePoint admins will frequently use the installfeature and uninstallfeature commands.  If a person accidentally hits the enter key after typing stsadm –o uninstall instead of stsadm –o uninstallfeature they will watch their whole SharePoint portal rendered useless in a matter of seconds.

Big lesson here is to be VERY careful with the uninstallfeature command and to make sure you always have a recent full farm backup available incase you make a mistake.

Leave a Reply