Wednesday, December 30, 2015

Tuesday, December 29, 2015

View All Site collections by using Power shell sharepoint 2013

Get-SPWebApplicaiton -Limit All | "|Get-SPSite | Format-Table -Property URL,ContentDatabase

Displays the URLS of all the web applications in a server farm and the site collections in each web application.

Manage the lock status for a site collection using power shell sharepoint 2013

Set-SPSite -identity "<SiteCollection>" -LockState "<State>"
State= Unlock /NoAdditions/Readonly/NoAccess

Restore a Deleted Site Collection using Power shell sharePoint 2013

When a site collection is deleted the deleted site collection is stored in the SPDeletedSite Object.
Restore-SPDeletedSite [-identity] <SPDeletedSitePipeBind> [...]

Restore-SPDeletedSite -identify guid or /sites/site_name or an SPDeletedSite Object

Delete a Site Collection Using Power shell SharePoint 2013

Remove-SPSite -Identity "<URL>" -GradualDelete

Create Site collection using power shell sharepoint 2013












Ex:1
New-SPSite -URL  "http://www.contoso.com/sites/eTeamSite"  -OwnerAlias "Contoso\Administrator" -Template "STS#0"


Ex:2

$template= Get-SPWebTemplate "STS#1"
New-SPSite  -URL "http://www.contoso.com/sites/Leere" -OwnerAlias "CONTOSO\GarethF" -Template $template


Saturday, March 28, 2015

SQL Blocking SQL Query

SELECT db.name DBName,
tl.request_session_id,
wt.blocking_session_id,
OBJECT_NAME(p.OBJECT_ID) BlockedObjectName,
tl.resource_type,
h1.TEXT AS RequestingText,
h2.TEXT AS BlockingTest,
tl.request_mode FROM sys.dm_tran_locks AS tl
INNER JOIN
sys.databases db ON db.database_id =tl.resource_database_id
INNER JOIN sys.dm_os_waiting_tasks AS wt
ON tl.lock_owner_address =wt.resource_address
INNER JOIN sys.partitions AS p ON
p.hobt_id =tl.resource_associated_entity_id
INNER JOIN sys.dm_exec_connections ec1 ON
 ec1.session_id =tl.request_session_id
INNER JOIN sys.dm_exec_connections ec2
ON
ec2.session_id =wt.blocking_session_id
CROSS APPLY  sys.dm_exec_sql_text(ec1.most_recent_sql_handle) AS  h1
CROSS APPLY  sys.dm_exec_sql_text(ec2.most_recent_sql_handle) AS  h2
GO



sp_who2

sp_who2  'spid'

kill  'spid'


Thursday, March 5, 2015

Information Rights Management :Protector could not be created as a generic COM object

Information Rights Management (IRM): Protector {78E40D5F-0C51-45B6-AC87-72119EC6669A} could not be created as a generic COM object (IUnknown). Protector: {78E40D5F-0C51-45B6-AC87-72119EC6669A} This indicates a major problem with the protector. Any COM object can be created as an IUnknown.

These errors are due to password protected filed being uploaded into SharePoint. Currently there is no action needed from an IT perspective.

Wednesday, March 4, 2015

List the available SharePoint site templates installed in your farm using Powershell

Get-SPWebTemplate | select ID, Name, Title | Sort-Object ID | Format-Table

Get-SPWebTemplate "STS#0"

List Active Databases used in sharepoint 2010 By Power Shell

Get List of All Databases
Goto SharePoint 2010 Management Shell

Get-SPDatabase | Sort-Objectdisksizerequired -desc | Format-Table Name

Get list of Content Databases

Get-SPContentDatabase | Sort-Object Name | Format-Table Name