Search This Blog

Showing posts with label STSADM. Show all posts
Showing posts with label STSADM. Show all posts

Thursday, December 17, 2015

Setsitelock: Stsadm operation

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.

Syntax
stsadm -o setsitelock
   -url <URL name>
   -lock {none | noadditions | readonly | noaccess}




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.

Examples
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


Monday, July 13, 2015

SharePoint Developer Dashboard

Developer Dashboard is a great feature on SharePoint 2010. This feature is disabled by default. And it provides performance and tracing information that can be used to debug and troubleshoot page rendering time issues. (slow page loads, web part issues, query delays) .Enabling this great feature will get critical information about execution time, log correlation ID, critical events, database queries, service calls, SPRequests allocation and webpart events offsets.

The Developer Dashboard feature is turned off by default, but it can be enabled very easy via stsadm or PowerShell.

Check status of Developer Dashboard
stsadm -o getproperty -pn developer-dashboard

Enable Developer Dashboard via stsadm:

�On� Mode:
stsadm -o setproperty -pn developer-dashboard -pv On

�OnDemand� Mode:
stsadm -o setproperty -pn developer-dashboard -pv OnDemand

Disable Developer Dashboard via stsadm:
stsadm -o setproperty -pn developer-dashboard -pv Off

Friday, June 26, 2015

How to Deactivate a SharePoint feature using PowerShell or STSADM

To Disable a SharePoint Feature, you must first determine the scope of the feature. If the scope is Web-based or is a site collection scope, the URL parameter is required. However, if the scope is farm-based, the URL parameter is not required.

Syntax - PowerShell

Disable-SPFeature [-Identity] <SPFeatureDefinitionPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Force <SwitchParameter>] [-Url <String>] [-WhatIf [<SwitchParameter>]]

This example disables the "MyCustom" Web site scoped feature at http://somesite.
Disable-SPFeature -identity "MyCustom" -URL http://somesite

This example disables all features in the subsite at http://somesite/myweb.
$w = Get-SPWeb http://somesite/myweb | ForEach{ $_.URL }
Get-SPFeature -Web $w |%{ Disable-SPFeature -Identity $_ -URL $w}

Syntax - STSADM

stsadm -o deactivatefeature
   -filename
   -name <feature folder>
   -id <feature ID>
   [-url] <URL name>
   [-force]

Parameter
Value
Description
filename
A valid file path, such as "MyFeature\Feature.xml"
Path to feature must be a relative path to the 14\Template\Features directory. Can be any standard character that the Windows system supports for a file name.
name
Name of the feature directory, such as �MyFeature�
Name of the feature folder located in the 14\Template\Features directory
id
A valid GUID, e.g.  �11d186e-7306-4902-a825-0eb7609e9280�
GUID that identifies the feature to activate
url
A valid URL, such as http://server_name
URL of the Web application, site collection, or Web site to which the feature is being activated


How to Activate a SharePoint feature using PowerShell or STSADM

To Enable a SharePoint Feature, you must first determine the scope of the feature. If the scope is Web-based or is a site collection scope, the URL parameter is required. However, if the scope is farm-based, the URL parameter is not required.

Syntax - PowerShell

Enable-SPFeature [-Identity] <SPFeatureDefinitionPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-CompatibilityLevel <Int32>] [-Confirm [<SwitchParameter>]] [-Force <SwitchParameter>] [-PassThru <SwitchParameter>] [-WhatIf [<SwitchParameter>]]

This example enables the "MyCustom" site scoped SharePoint Feature at http://somesite.
Enable-SPFeature -identity "MyCustom" -URL http:// sitename

This example enables all SharePoint Features in the subsite at http://somesite/myweb.
$w = Get-SPWeb http://somesite/myweb | ForEach{ $_.URL }
Get-SPFeature -Web $w |%{ Enable-SPFeature -Identity $_ -URL $w}

Syntax - STSADM

stsadm -o activatefeature
   {-filename <relative path to Feature.xml> | -name <feature folder> | -id <feature ID>}
   [-url] <URL name>
   [-force]

Parameter
Value
Description
filename
A valid file path, such as "MyFeature\Feature.xml"
Path to feature must be a relative path to the 14\Template\Features directory. Can be any standard character that the Windows system supports for a file name.
name
Name of the feature directory, such as �MyFeature�
Name of the feature folder located in the 14\Template\Features directory
id
A valid GUID, e.g.  �11d186e-7306-4902-a825-0eb7609e9280�
GUID that identifies the feature to activate
url
A valid URL, such as http://server_name
URL of the Web application, site collection, or Web site to which the feature is being activated

Note : If you try to use the Url parameter on a farm-scoped feature, you receive the following error message:
The feature �<feature name>� applies to the entire farm; the Url parameter cannot be used with farm-scoped features.

Monday, March 2, 2015

List of all SharePoint custom solutions and deployed web applications in the farm

      I was working on getting all the custom solutions in the farm. This could be obtained from the Central Administration. (Central Administration -> System Settings -> Manage farm solutions)

I wanted this list of solutions and also the web applications where they were deployed. I worked with a friend and came up with a PowerShell script to do this. This will definitely save you some time.

PowerShell Script

$File = "E:\SolutionandDeployedWebApplications.txt"
foreach ($solution in Get-SPsolution)
{
echo $solution.Name | Out-File $File -Append
echo $solution.DeployedWebApplications | Format-Table -Property Url | Out-File $File -Append

}

Friday, February 27, 2015

SharePoint Farm Solution Details

Below is a set of PowerShell commands and stsadm command to get the solution details in the farm.

1. To list all the solutions - Returns solution name, id and deployed status

Get-SPSolution

2. To list all the properties of a particular solution

Get-SPSolution �identity solutionname.wsp | select *

3. List all solutions, properties and output to a file to read

Get-SPSolution | select * > E:\SolutionDetails.txt

4. List all solutions, properties and output to a file to read (using ststadm)

stsadm.exe -o enumsolutions > E:\SolutionDetails.txt

Tuesday, November 12, 2013

STSADM for Starting and Stopping Sharepoint services on a farm


Today a colleague wanted to stop some SharePoint services using PowerShell. I tried doing the same in STSADM.This is how you do the same using STSADM

To list out all Sharepoint services

stsadm -o enumservices [I am listing only some of them below]

<Services>
  <Service>
    <Type>Microsoft.Office.Access.Server.MossHost.AccessServerWebService, Microsoft.Office.Access.Server, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Type>
    <Name />
    <DisplayName>Access Services 2010</DisplayName>
    <Status>Disabled</Status>
  </Service>
  <Service>
    <Type>Microsoft.Office.SecureStoreService.Server.SecureStoreService, Microsoft.Office.SecureStoreService, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Type>
    <Name />
    <DisplayName>Secure Store Service</DisplayName>
    <Status>Disabled</Status>
  </Service>
  <Service>
    <Type>Microsoft.Office.Server.PowerPoint.Administration.PowerPointConversionService, Microsoft.Office.Server.PowerPoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Type>
    <Name />
    <DisplayName>Microsoft.Office.Server.PowerPoint.Administration.PowerPointConversionService</DisplayName>
    <Status>Disabled</Status>
  </Service>
<Service>
  <Type>Microsoft.SharePoint.BusinessData.SharedService.BdcService, Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Type>
  <Name />
  <DisplayName>Business Data Connectivity Service</DisplayName>
  <Status>Disabled</Status>
</Service>
<Services>

To start a service

stsadm -o provisionservice -action start -servicetype Microsoft.SharePoint.BusinessData.SharedService.BdcService

To stop a service

stsadm -o provisionservice -action stop -servicetype Microsoft.SharePoint.BusinessData.SharedService.BdcService

If this is a Web service, IIS must be restarted for the change to take effect.  To restart IIS, open a command prompt window and type "iisreset /noforce".


Propellerads