STSADM at Your Service

This week I send you greetings from beautiful San Diego, California, where we're launching the SharePoint Pro Live! tour. For the next six weeks, we’ll be hitting ten cities across the country with a fantastic set of technical workshops for IT professionals. Come join us for an independent, expert view into SharePoint Products and Technologies!

 

STSADM at Your Service
Anyone who does anything with SharePoint knows that the Stsadm.exe command is indispensible. It’s used for so many administrative, troubleshooting, and maintenance tasks. Problem is, it’s buried way deep down inside the Program Files directory, and you need to dig down to that location before you can start using the command. Here’s a great tip for making Stsadm easier to get to and easier to use.

1. Open Notepad and enter the following commands. Each bullet represents one line in the text file:

• @echo off
• set path=%path%;c:\program files\common files\microsoft shared\web server extensions\12\bin
• d c:\
• @echo on

2. Save the file as “STSADM Command Prompt.bat” in a location accessible to both your normal user account and your administrative user account (if they are different). The batch file can be hidden away somewhere--but it's important that you have permission to read the file as both your normal user account and your administrative account.

3. Create a shortcut to the batch file. Put the shortcut somewhere very accessible, like on your desktop or in your Start menu.

4. Open the properties of the shortcut. On the TARGET line, add to the beginning of the line: cmd.exe /k

5. Click the Apply button. Windows will change cmd.exe /k to c:\windows\system32\cmd.exe /k.

• The Target line will now read:
C:\WINDOWS\system32\cmd.exe /k "path\STSADM Command Prompt.bat"

6. Click the Advanced button.

7. On Windows Vista or Windows Server 2008, select Run As Administrator. On Windows XP or Windows Server 2003, choose Run With Different Credentials (assuming you use a separate, administrative account to run Stsadm).

Double-click the shortcut. You’ll be prompted to run the shortcut with appropriate administrative credentials. Then a command prompt will open, set to the root of the C:\ drive (based on the third line in the batch file). Type path and press Enter. You’ll see that the system path now includes the folder in which Stsadm is found. That folder was added to the system path by the second line in the batch file.

Test the command prompt by typing STSADM /? and pressing Enter. You’ll see the usage information for Stsadm.exe displayed. Now you can use Stsadm commands to administer the server without having to dig into the deepest crevices of the Program Files folder.

Enjoy the easy access to Stsadm! Until next time, stick to the SharePoint!

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish