Project Description

The aim of this project is to add operations to default STSADM command line tool which is opened to extensions.

STSADM can be used for scripting operations so you can run scheduled tasks or run commands on your SharePoint server without having a remote control screen.

Most of these extensions are used during SharePoint site import to another environment (transport package and import script are generated using a tool that will be soon available on CodePlex).

Available operations

Open a command line window (Run cmd) and type one of the following commands:
Legend: <> = element that must be filled, [] = not mandatory element.

Emptylist
Removes all items for specified list.
stsadm –o emptylist
-url < Full url to a site in SharePoint >
-list List Name

Emptyrecyclebin
Removes all items from recycle bin in the specified site.
stsadm –o emptyrecyclebin
-url < Full url to a site in SharePoint >

Enumfeatures
Lists all features actived on the specified scope (site collection, site or list).
stsadm –o enumfeatures
-url < Full url to a site in SharePoint >
[-list List Name ]

Enumfields
Lists all existing fields from specified list.
stsadm –o enumfields
-url < Full url to a site in SharePoint >
-list List Name

Relinkinfopathforms
Relinks all InfoPath forms in the specified list.
stsadm –o relinkinfopathforms
-url < Full url to a site in SharePoint >
-list List Name
Remark: Code is coming from following post: http://officepoint.blogspot.com/2008/06/sharepoint-relink-infopath-forms-relink.html

Setfieldproperties
Allows modifications to field properties.
stsadm –o setfieldproperties
-url < Full url to a site in SharePoint >
-list List Name
-field < Field Name >
[-hide]
[-peoplefieldgroupfilter Group Name ]

Setgroupproperties
Allows modifications to SharePoint groups properties.
stsadm –o setgroupproperties
-url < Full url to a site in SharePoint >
-group < Group Name >
[-owner Group Name ]

Setuserproperties
Allows modifications to SharePoint user properties.
stsadm –o setuserproperties
-login < Login Name >
[-email Email Address ]

Prerequisites

Windows SharePoint Services 3.0 or Microsoft Office SharePoint Server 2007 on the server you will run STSADM commands.

Installation

Installation of this package will run with STSADM command line tool itself with the installsolution and deploysolution operations.
An install.bat file is provided and will do all required operations. The only you have to do is to click on it and wait for less than one minute.
Remark: These operations will automatically do an iisreset. Be sure you are able to stop your SharePoint server for some seconds.

Future developments

Following commands are a here for information only. Operations are subject to change.

AttachWFtoList
Allows adding workflow to list.
stsadm –o attachwftolist
-url < Full url to a site in SharePoint >
-list List Name
-workflow < Workflow Name >

AttachEventHandlerToList
Allows adding event handler to list.
stsadm –o attacheventhandlertolist
-url < Full url to a site in SharePoint >
-list List Name
-eventhandler < Workflow Name >

SetWebPartProperties
Allows modifications to webparts properties.
stsadm –o setwebpartproperties
-url < Full url to a site in SharePoint >
[-hide]

Disclaimer

Source code is provided as is. Please install and test on a test environment before running it on production environment.
Support will be done according to my availability. Please use Issue Tracker or Discussions according of the topic. Feel free to send your feedback about useful parameters.

Last edited Oct 19, 2008 at 8:01 PM by didierdanse, version 4