Deleting List Items Through PowerShell

Use the following code to delete SharePoint list items through PowerShell. This code comes handy, if you have humongous amount of data in a list and you want to delete it.

$web = Get-SPWeb http://servername/sites/sitename
$listName = "samplelist"
$list = $web.Lists[$listName]
$items = $list.Items 

Write-Host $items.Count
for($i=$items.Count-1;$i -ge 0;$i--  )
{
Write-Host $list.Items[$i].id
$list.Items[$i].Delete()
}

Advertisements

Ports that are required for communication between servers – SharePoint

Following shows ports that are required for communication between servers (App, WFE & DB) for SharePoint.

 

Protocol Port Usage Comment Server Source IP(s) Destination IP(s)
TCP 80 HTTP Client to SharePoint web server traffic (SharePoint – Office Web Apps commun..) SharePoint/ Project Server (Web Front End)  

 

Client Machines

 

 

WFE

App

TCP 90 HTTP Client to SharePoint web server traffic (SharePoint – Office Web Apps commun..) SharePoint/ Project Server (Web Front End)  

Client Machines

 

 

WFE

App

TCP 443 HTTPS/SSL Encrypted client to SharePoint web server traffic (Encrypted SharePoint – Office Web Apps commun..) SharePoint/ Project Server (Web Front End)  

Client machines

 

 

WFE

App

TCP 25 SMTP for e-mail integration Cannot be configured SMTP Server App (SMTP)
TCP 1433, 445 SQL Server using named pipes (445), SQL Server default commun.. port (1433). Client to Database server Database Server App DB

Error occurred in deployment step Activate Features

If deploying WSP using Visual Studio, you’ll end up with the following error.

Error occurred in deployment step ‘Activate Features’: Feature with Id ‘8a442317-1158-4994-b265-26499b2def57’ is not installed in this farm, and cannot be added to this scope.

Solution:

Just manually created package and deploy

Courtesy:
http://blogs.msdn.com/b/calvarro/archive/2011/11/06/sharepoint-2010-amp-visual-studio-2010-error-ocurred-activate-features-feature-with-id-installed-in-this-farm-cannot-be-added-to-this-scope.aspx