
Optimizing SharePoint Administration with STSADM Commands
Discover the power of STSADM, an extensible command line interface for managing SharePoint environments. Learn usage tips, best practices, and common commands to enhance your SharePoint administration efficiency.
Download Presentation

Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.
E N D
Presentation Transcript
Gary Lapointe, Senior Consultant, Statra Inc. Microsoft Office SharePoint Server MVP STSADM
Agenda What is STSADM? Usage Tips & Best Practices Some Common Commands Extending STSADM Development Best Practices
What is STSADM? An extensible command line interface for administering SharePoint Not limited to administrative needs can be extremely helpful to developers Easier than PowerShell But start learning PowerShellif you want to be prepared for vNext Contains ~186 commands OOTB My extensions add 131 additional commands
Usage Tips & Best Practices Use an install script to configure your farm using psconfig and stsadm Allows setting of options that can t be done via the PSConfigwizard or the browser Configurations are self-documenting Easier to replicate configurations between various environments Make sure you are running as your SharePoint Administrator/Setup account (spadmin) It s generally a good idea to disable this account when not needed for administrative tasks
Usage Tips & Best Practices Add the 12 hive s bin folder to your PATH environment variable Configure the layout properties of the console window to make it easier to view the history of long running operations Enable Quick Edit in the Options tab
Usage Tips & Best Practices Use the FIND command to help locate unfamiliar commands: stsadm-help | find ecs /I /N Finds Excel Services related commands stsadm-help | find gl- Finds all my custom commands
activatefeature createssp enumcontentdbs grantiis7permission renameserver setsitedirectoryscanschedule activateformtemplate enumdataconnectionfiledependants renamesite setsitelock createweb import addalternatedomain enumdataconnectionfiles renameweb setsiteuseraccountdirectorypath databaserepair installfeature addcontentdb enumdeployments setsspport restore deactivatefeature listlogginglevels adddataconnectionfile enumexemptuseragents setworkflowconfig deactivateformtemplate listregisteredsecuritytrimmers restoressp add-ecsfiletrustedlocation enumformtemplates siteowner deleteadminvs localupgradestatus retractsolution add-ecssafedataprovider enumgroups spsearch deletealternatedomain managepermissionpolicylevel retractwppack add-ecstrusteddataconnectionlibrary enumroles deletecmsmigrationprofile mergecontentdbs spsearchdiacriticsensitive runcmsmigrationprofile add-ecsuserdefinedfunction enumservices deleteconfigdb migrateuser sync runcontentdeploymentjob addexemptuseragent enumsites deletecontentdb syncsolution osearch scanforfeatures addpath enumsolutions deletegroup trimauditlog osearchdiacriticsensitive setadminport addpermissionpolicy enumssp deletepath unextendvs preparetomove setapppassword enumssptimerjobs addsolution deletepermissionpolicy uninstallfeature profilechangelog setbulkworkflowtaskprocessingschedul e enumsubwebs addtemplate deletesite unquiescefarm profiledeletehandler setconfigdb enumtemplates adduser unquiesceformtemplate deletesolution provisionservice setcontentdeploymentjobschedule enumusers addwppack unregistersecuritytrimmer deletessp quiescefarm setdataconnectionfileproperty enumwppacks addzoneurl unregisterwsswriter deletessptimerjob quiescefarmstatus setdefaultssp enumzoneurls allowuserformwebserviceproxy updateaccountpassword deletetemplate quiesceformtemplate set-ecsexternaldata execadmsvcjobs allowwebserviceproxy deleteuser reconvertallformtemplates updatealerttemplates set-ecsloadbalancing associatewebapp export deleteweb refreshdms updatefarmcredentials set-ecsmemoryutilization authentication deletewppack refreshsitedms extendvs upgrade set-ecssecurity backup deletezoneurl registersecuritytrimmer extendvsinwebfarm upgradeformtemplate set-ecssessionmanagement backuphistory registerwsswriter deploysolution forcedeletelist upgradesolution set-ecsworkbookcache binddrservice removedataconnectionfile deploywppack formtemplatequiescestatus upgradetargetwebapplication setformsserviceproperty blockedfilelist removedrservice disablessc getadminport uploadformtemplate setformtemplateproperty canceldeployment remove-ecsfiletrustedlocation displaysolution getdataconnectionfileproperty userrole setholdschedule changepermissionpolicy remove-ecssafedataprovider editcmsmigrationprofile getformsserviceproperty verifyformtemplate setlogginglevel copyappbincontent remove- editcontentdeploymentpath getformtemplateproperty ecstrusteddataconnectionlibr ary setpolicyschedule createadminvs editssp getproperty setproperty createcmsmigrationprofile remove-ecsuserdefinedfunction email getsitedirectoryscanschedule setrecordsrepositoryschedule creategroup removeexemptuseragent enablecmsurlredirect getsitelock setsearchandprocessschedule createsite removeformtemplate enablessc getsiteuseraccountdirectorypath setsharedwebserviceauthn removesolutiondeploymentlock createsiteinnewdb enumalternatedomains geturlzone
gl-deletelistfield gl-fixpagecontact gl-setallowaccesstoonlinegallery gl-addaudiencerule gl-deletelistitem gl-setanonymousaccess gl-fixpublishingpagespagelayouturl gl-addavailablesitetemplate gl-deletelistview gl-setaudiencecompilationschedule gl-addeventreceiver gl-fixvariationrelationships gl-deleteweb2 gl-setauditsettings gl-addlist gl-gen2003to2007profilepropertymap gl-deletewebapp gl-setjobschedule gl-getjobinfo gl-addlistitem gl-disableuserpermissionforwebapp gl-setlistcontenttypes gl-getjobinfos gl-addlistviewwebpart gl-editprofileproperty gl-setlocalsitedirectory gl-getlistschemaxml gl-addnavigationnode gl-editquotatemplate gl-setmastersitedirectory gl-import2 gl-addsearchrule gl-enableuserpermissionforwebapp gl-setmetadata gl-addsiteadmin gl-importlist gl-enumaudiencerules gl-setnavigationnodes gl-adduser2 gl-importlistfield gl-enumavailablepagelayouts gl-setnavigationsettings gl-adduserpolicyforwebapp gl-importlistfolder gl-enumavailablesitetemplates gl-setpictureurl gl-applytheme gl-importlistitem gl-enumeffectivebaseperms gl-setpictureurlnewpath gl-applyupgradeareaurlmappings gl-importlistsecurity gl-setprofileprivacypolicy gl-enumemailenabledlists gl-backup gl-importprofileproperties gl-setsearchcenter gl-enumeventreceivers gl-importsitecolumns gl-backupsites gl-setselfservicesitecreation gl-enumfeatures gl-listaudiencetargeting gl-connecttoportalsite gl-setsitedirectoryscanviewurls gl-enuminstalledsitetemplates gl-managecontentdbsettings gl-convertsubsitetositecollection gl-setsitegeneralsettings gl-enumnavigation gl-migrate2003profilesto2007 gl-copycontenttypes gl-setsitenamingformat gl-enumpagewebparts gl-movesite gl-copylist gl-setsspacl gl-enumprofileprivacypolicies gl-moveweb gl-copylistitem gl-setusageanalysis gl-enumprofileproperties gl-movewebpart gl-copylistsecurity gl-setuserprofiledefaultaccessaccount gl-enumtimerjobdefinitions gl-mysitesettings gl-copynavigation gl-enumunghostedfiles gl-setuserprofileimportschedule gl-propagatecontenttype gl-createaudience gl-enumwelcomepages gl-setwebpartstate gl-publishitems gl-createcontentdb gl-exportcontenttypes gl-sitewelcomepage gl-reghostfile gl-createpublishingpage gl-tracelog gl-exportlist gl-removeavailablesitetemplate gl-createquotatemplate gl-unextendwebapp gl-exportlistfield gl-repairsitecollectionimportedfromsubsite gl-createsearchscope gl-updatedefaultcontentaccessaccount gl-exportlistfolder gl-replacefieldvalues gl-createsiteindb gl-updatelistfield gl-exportlistitem gl-replacewebpartcontent gl-createwebapp gl-updatelistview gl-exportlistitem2 gl-retargetcontentquerywebpart gl-deleteallusers gl-updatesearchscope gl-exportlistsecurity gl-retargetgroupedlistingswebpart gl-deleteaudience gl-updatev2tov3upgradeareaurlmappings gl-exportsitecolumns gl-runprofileimportjob gl-deleteeventreceiver gl-upgrade2 gl-extendwebapp gl-runtimerjob gl-deletelist
Extending STSADM Implement Microsoft.SharePoint.StsAdmin. ISPStsAdmCommand GetHelpMessage(string command) Run(string command, StringDictionary keyValues, out string output) For error conditions return Microsoft.SharePoint.StsAdmin.ErrorCodes ErrorCodes.GeneralError ErrorCodes.SyntaxError
Extending STSADM GetHelpMessage is called when the user enters the following at the system prompt, where myOperation is the name of your custom operation. stsadm -help myOperation GetHelpMessage is also called when Run() returns SyntaxError. The String that is returned is usually the only syntax help available to users of the command operation. So include everything that they needs to know, including the possible parameters, if any, that can be used with the operation. Use standard syntax guidance style. Use "[" and "]" to indicate material that is optional. When more than one parameter can be used, use "|" to separate the alternatives. Variables should be enclosed in "<" and ">". The following string is automatically prepended to the return value; do not set it explicitly. "stsadm -o command \n" http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.stsadmin.ispstsadmcommand.gethelpmessage.aspx
Development Best Practices Prefix your command names with something reasonably unique (your initials, company stock symbols, etc.) Always provide some sort of help for the command Validate all input parameters before using Deploy your custom commands using a WSP Abstract your core code into methods in case you need to repurpose it for a Feature Use my CodePlex template as a starting place - http://www.codeplex.com/customstsadmtemplate
Resources My custom extensions: http://stsadm.blogspot.com/ Starter template to write your own extensions: http://www.codeplex.com/customstsadmtemplate MSDN http://msdn2.microsoft.com/en-us/library/bb417382.aspx Mindsharp white paper on STSADM https://www.mindsharp.com/default.aspx?premium=downloads&file=sts admpart1.pdf STSADM command line reference http://www.wssdemo.com/Lists/stsadm/AllItems.aspx Inside SharePoint 2007 Administration http://www.courseptr.com/ptr_detail.cfm?&isbn=978%2D1%2D58450%2 D601%2D0