Sets a value that specifies whether the site collection is locked and unavailable for read or write access. This operation should be used in conjunction with the Getsitelock operation. For more information, see the Examples section.
A common situation where the getsitelock and setsitelock operations are useful is when a site is backed up. Typically, before you back up a site collection, the site should be locked and no users should have access to it.
To determine the lock status of the site, you can use the following getsitelock syntax:
stsadm -o getsitelock -url
http://server_name
Once the lock status of the site collection is determined, you can use the noaccess parameter of the setsitelock operation to lock out all users to the site:
stsadm -o setsitelock -url
http://server_name
-lock noaccess
You can use the Backup operation to create a backup of the site collection:
stsadm -o backup -url
http://server_name
-filename "filename.bak" -overwrite
After the site has been backed up, you can use the none parameter of the setsitelock operation to remove all locks to the site:
stsadm -o setsitelock -url
http://server_name
-lock none