yeah yeah, if you are used to working with MOSS, then you will probably tell me to use the command stsadm -o setsitelock -url <url> -lock readonly or something like that.
Unfortunately back in the SharePoint Portal Server 2003 and WSS 2.0 days, this operation was no yet available with stsadm…..along with a lot of other usefull commands
I needed to lock the sps 2003 sites in a gradual upgrade project to MOSS. Of course I want to script the complete migration, which also includes locking the SPS site before starting the upgrade.
Searching the web, I found my way to the SPSiteManager project on Codeplex
In addition to the opeartions I was looking for, you also get the following operations:
|
Operation |
Description |
|
analyze |
Enumerate all Content Database information and generate a Site Distribution Document |
|
repartition |
Re-partition sites to different content databases |
|
enumsites |
Enumerate Site Collections |
|
Enumsitecrawl |
Enumerate URL references from the list of sites to crawl |
|
Enumsitedirectory |
Enumerate URL references from a portals site directory |
|
enumdatabases |
Enumerate Content Databases |
|
backup |
Backup site(s) |
|
restore |
Restore site(s) |
|
deletesite |
Delete site(s) |
|
adddatabase |
Add content databases to a virtual server |
|
addfromcrawl |
Add site(s) to list of sites to crawl for SharePoint Portal Server 2003 |
|
removefromcrawl |
Remove site(s) to list of sites to crawl for SharePoint Portal Server 2003 |
|
addfromdirectory |
Add site(s) to Portal Server 2003 Site Directories |
|
removefromdirectory |
Remove site(s) to Portal Server 2003 Site Directories |
|
locksite |
Lock site(s) |
|
unlocksite |
Unlock site(s) |
|
resetquota |
Reset quotas on site(s) |
|
purgeversions |
Purge document versions from document libraries |
Although these operations look a lot like the ones we get with MOSS, nowadays, they actually are much better. For example the operation to backup a site will actually also lock the site for read/write for you and unlock it when done. So before using this tool with all the operations, be sure to check out the well written manual that is included explaining each operation.



Thanks a lot, you saved my day. I asked the same question here on technet but no one could answer.
http://social.technet.microsoft.com/Forums/en-US/sharepointadmin/thread/1251dff4-3f6a-4fb2-b756-d0496a2a2169
Hello Jayvardahn Patil,
I remember when I first used the SPSiteManager tool, I encountered an undesired effect, which was that the site was both locked Read and Write, resulting in no access at all. My users still needed access to the SPS2003 site, but in read-only mode.
If this is also the case with you, you may try to edit the AppClass.cs file in the source code and look for the following peace of code:
private static void SetSiteLockState(JobSettings js, bool bLocked)
{
Logging.Information(“===================================================”);
Logging.Information(“Setting site lock state”);
Logging.Information(“===================================================”);
Logging.Information(” Site: ” + js.SourceUrl);
SPSite site = js.GetSite();
site.ReadLocked = site.WriteLocked = bLocked;
site.Close();
site.Dispose();
}
Next ,change the line:
site.ReadLocked = site.WriteLocked = bLocked;
To:
site.WriteLocked= bLocked;
Save the file, then run the BuildSPS batch file to generate the executable (run this on a SharePoint server as it requires the SharePoint dll)
Good Luck
Dirk Van den Berghe
SharePoint Blog: http://dirkvandenberghe.com
There was a specific reason for both write AND read locking the site. THought I had placed the comment for it in the code, and trying to find the information now, but let’s just say, it can get things out of sync when backing up a 2.0 site if you don’t read AND write lock it.
I don’t recommend only write locking it when backing up (For 2.0 that is)
Found the reason..It’s Primarily during a restore, but just recommend for backup as well.
See the following for more details.
http://blogs.msdn.com/krichie/archive/2006/07/25/678040.aspx