Export (0) Print
Expand All
3 out of 5 rated this helpful - Rate this topic

Setsitelock: Stsadm operation (Windows SharePoint Services)

SharePoint 2007

Updated: April 28, 2009

Applies To: Windows SharePoint Services 3.0

Updated: 2009-04-28

Description

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.

ImportantImportant:

In Service Pack 2 for SharePoint Products and Technologies, site collections are automatically locked as read-only before a backup process occurs. Therefore, there is no need to use the Setsitelock: Stsadm operation (Windows SharePoint Services) operation. If you do not want site collections to be locked as read-only, you must specify the nositelock parameter of the Backup: Stsadm operation (Windows SharePoint Services) operation that is available in Windows SharePoint Services 3.0 with Service Pack 2 (SP2).

Syntax

stsadm -o setsitelock

   -url <URL name>

   -lock {none | noadditions | readonly | noaccess}

Parameters

Parameter name Value Required? Description

url

A valid URL, such as http://server_name

Yes

The URL of the site collection.

lock

Any of the following values:

  • None: Sets the site collection to unlock.

  • Noadditions: Permits changes that reduce the size of the data.

    For example, if you had an announcement list item whose body consisted of 50 characters, you could successfully edit the list item so that the body was reduced to 25 characters. However, if you tried to edit the list item so that they body was increased to 100 characters, that would be blocked.

  • Readonly: Sets the site collection to read-only.

  • Noaccess: Sets the site collection unavailable to all users.

Yes

Set the lock status of the site collection.

Examples

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

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.