CLI: Unextend / Extend Web Application

If you want to unextend (delete) your SharePoint site, this is an easier way to do it, blogged earlier.

STSADM.exe -o unextendvs -url http://%computername% -deletecontent -deleteiissites

Similar to this is the extend script.

 STSADM.exe -o extendvs -sethostheader -url http://%computername% -apcreatenew -apidtype NetworkService -apidname SharePointSite -ownerlogin domain\username -owneremail someone@justsharepoint.com -lcid 1033 -sitetemplate STS#0 -exclusivelyusentlm

If you want Kerberos instead of NTLM, change the last parameter in the script to negotiate. Ignore warnings at your risk, but you do need to refer to the KB mentioned in the warning for additional steps that will be required to be carried out by your systems administrator.

You can find the scripts on my skydrive.

HowTo: Enable and Start SQL Browser Service

In Sql Express 2005 installation, SQL Browser service is disabled by default.

To enable and start the sql browser service using cli (command line interface), use the following commands.

sc config sqlbrowser start= auto

net start sqlbrowser

STSADM: Create MySite

To create MySite using STSADM.exe, use the following command

stsadm -o createsite -url http://servername/personal/username -ownerlogin domain\username -owneremail user@domain.com -sitetemplate SPSPERS

Note: Please do not copy paste this code. Type it in.

Tip: Recycle IIS Application Pool

As a developer, quite often you may have to recycle the application pool. IISReset is an option, alternatively you can just recycle a particular application pool.

Denny has a tip to just get this done!

cscript c:\windows\system32\iisapp.vbs /a “[App_Pool_Name]” /r

Source