For SharePoint developers, the use of the STSADM command has NOT gone away with SharePoint 2010 – interesting to note that it’s still called STSADM – as in SharePoint Team Services – a throw-back to the old SharePoint 2001 days (!)
Yes, I’m aware that PowerShell does much of the same stuff, but there’s still a need for STSADM – and this ‘tip’ is for SharePoint 2007 – and 2010 alike.
How many times have you had to do this (for example) :
"C:Program FilesCommon FilesMicrosoft Sharedweb server extensions14BINSTSADM.EXE” –o enumsolutions
It’s such a loooong path to have to either :
- Type it in manually – who does that ?!!?
- Navigate with Windows Explorer – and then copy the path (address bar) to a Command Prompt (DOS) window
Here’s a quick tip – so that you only need to type STSADM :
STSADM.EXE –o enumsolutions
Add the path to ENV variables
What you need to do is add the big looong path to the server ‘environment variables’ – these are the steps for Windows Server 2008 (much the same for 2003) :
- Click Start – and then just type “SYS VAR” (without quotes)
- The Windows start menu will show the items that match – from Control Panel
- Click the item shown – which is “Edit the system environment variables”
- Click on the button for ‘Environment Variables’
- Scroll down the SECOND list box – with the System Variables
- Click on the variable called Path – and click Edit
- Then paste in the PATH to the SharePoint Root folder (BIN)
- IMPORTANT : Don’t REPLACE the current PATH value – just append to the tail
- Make sure you include a semi-colon between the previous value
- AND – make sure you wrap it with quotes – as there are spaces in the value
- For SharePoint 2007 :
- ;"C:Program FilesCommon FilesMicrosoft Sharedweb server extensions12BIN"
- For SharePoint 2010 :
- ;"C:Program FilesCommon FilesMicrosoft Sharedweb server extensions14BIN"
- Click OK – and then OK again – and once more – basically just need OK your way outta there…
And – that’s it – you can now just type STSADM instead of needing the entire PATH to the BIN folder.
** NB. You’ll need to close and re-open the Command Window – if you already have one open. The Environment Variables are re-loaded when each NEW Command Window is opened.