SharePoint Delete Orphan Items

Deleting Orphan Features

Many of the times in deployment you many face issue of orphan features due to deployment fails, in that case features remains orphan and while redeployment it complains that feature is already installed.

In those cases you need to remove those orphan entries. you can use below command to get all orphan features

Get-SPFeature | ? { !$_.Scope }

And to delete all those orphan features you can use

Get-SPFeature | ? { !$_.Scope } | % { $_.Delete() }

Deleting Orphan Sites

Same way you might end up sometimes in orphan sites and that you can remove by using below command.

$site = Get-SPSite “your site collection name”;
$siteId = $site.Id;
$siteDatabase = $site.ContentDatabase;
$siteDatabase.ForceDeleteSite($siteId, $false, $false);

For more information on orphan sites you may refer http://social.technet.microsoft.com/wiki/contents/articles/21968.sharepoint-deleting-orphan-sites.aspx

Happy Reading! 🙂

SharePoint Online: Enable and Set Record Management settings using PowerShell & CSOM and Route records to Record Center Site

Original article was published on Technet Wiki by myself. here again pasting to retain original version.

Background

Records management is an interesting topic in SharePoint. It is one of the important aspect when dealing with sensitive and business critical data/documents.

Those Record documents can be treated as “Read-Only” copy, easily searchable using e-discovery sites and can be used for different legal, financial and business crucial data.

Note: I assume that you are aware about the Record Management functionality in SharePoint. I am not concentrating on explaining the functionality of Record Management but just trying to give bit background about it.

From Record management – “In SharePoint Online, you can manage records “in place,” which means that you can leave a document in its current location on a site, or you can store records in a specific archive called a Records Center site. The Records Center is intended to serve as a central repository in which an organization can store and manage all of its records, such as legal or financial documents. The Records Center supports the entire records management process, from records collection through records management to records disposition. If you choose in-place records management instead of the Records Center, you can still use any feature available in the Records Center, such as information management policy enforcement, routing, and hold, to manage records on any site.”

Please check more details on how to plan for record management from

Choose how to store and manage records

Implement Records Management

Functional Requirement

Consider a case when company having different collaborations sites and they want to store their documents as records to one of the central place as ‘Record Center’. We want to achieve this using PowerShell and CSOM followed by some manual configurations where CSOM APIs are not available yet. Admin user can use PowerShell to enable and set record declaration settings for any particular site collection as and when go.

Continue reading “SharePoint Online: Enable and Set Record Management settings using PowerShell & CSOM and Route records to Record Center Site”