News, 4th January 2010

This tool works fine with SharePoint 2010 because stsadm is still present in this version.
However, I will not maintain it anymore because now SharePoint administration can be done with PowerShell. With PowerShell, administrators can execute remote commands, therefore netstsadm has become obsolete.
Please refer to Microsoft documentation regarding PowerShell.


Project Description

This tool will allow you to remotely execute "stsadm" commands against a SharePoint environment. No need to log onto the SharePoint server (or one of the server that is part of the farm) in order to run administration commands : everything can be done from your workstation.

The idea behind this tool was to provide a procedure that could allow us, developers, to develop new SharePoint applications from a standard Vista (or XP) workstation. The benefit is we do not need to run Visual Studio from a server, or from a Virtual Machine. For french speaker, you can refer to this article.

Usage

This tool is split into two parts :
* One WCF service that must be executed on one of the SharePoint server
* One standalone console application that connects to the service and sends stsadm commands.

Basically, you launch the service onto the server (double click the NetstsadmService.exe),

ServiceUI.png

We can specify the port number the service will listen on and if we want the service to run anonymously or not. If not, valid credentials will have to be provided by the client.

From a remote workstation, open a prompt window / powershell in order to run the netstsadm.exe tool.

To understand the benefit of this tool, assume that you want to enumerate all available SSP in a SharePoint farm. From one of the SharePoint server (logged via RDP for instance), you would execute the command :

stsadm -o enumssp -all

With this tool, and considering the service is running on one server, and that this service is accessible via the URL http://SharePoint:Port, from you workstation, the command above will become :

netstsadm -TargetURL http://[SharePoint]:[Port] -o enumssp -all

The parameter TargetURL will point to the WCF service that runs, and the rest of the parameters are the same as you would use in a stsadm command.
If the service is not anonymous, add the parameters TargetLogin (domain\username) and TargetPwd to specify valid credentials.

You can also write those parameters in the configuration file, so that you do not need to pass them as command line arguments. To access the configuration file, run

netstsadm -config

Notepad will open, letting you specify those 3 parameters

ClientConfig.png

If you use an operation that requires a file to be specified (addsolution, addtemplate, backup, restore or so on) the tool will first upload the file onto the destination server in the temporary folder (given by Path.GetTempPath()), and then reformat the stsadm command to include the new path to the file specified.

You can follow which commands are executed on the server, as they will be displayed on the window hosting the service :

ServiceUI_running.png

Feel free to post any comments or issues you may have.

My blog : http://www.sharepointofview.fr/Julien

Last edited Feb 24, 2010 at 3:20 PM by jucho, version 11