|
Name
|
Port
Numbers
|
Comments
|
|
Any to Any
|
All Ports
|
|
|
Index Server/Query Server
|
Use Ports other than 80, 443
|
Cannot use it out side
|
|
SSP
|
Use Ports other than 80, 443
|
Cannot use it out side
|
|
My Site
|
Use Ports other than 80, 443
|
Cannot use it out side
|
|
Fileshare UDP
|
135-139,445
|
|
|
SharePoint SMB Ports
|
445,137,138,139
|
|
|
SharePoint Http
|
56737, 56738
|
If you are not adding this you will get Could not
connect to Query Server Error.
|
Wednesday, September 09, 2015
SharePoint 2007 Ports
Tuesday, September 08, 2015
SharePoint 2010 and SharePoint 2013 Firewall Ports
| Inbound/Outbound | From | Port | Type | To | Version |
| Inbound | Service Application | 32843, 32844 (HTTPS), 32845 (net.tcp binding) | HTTP | SharePoint Web Service | SP2010, SP2013 |
| Inbound | WFE (mail enabled list) | SMTP (TCP 25) | SP2010, SP2013 | ||
| Inbound | Index | TCP 80 or 443 | WFE | SP2010, SP2013 | |
| Inbound | All SharePoint Servers, but where Forefront Identity Management agent is installed | TCP/5725 | – | Active Directory | SP2010, SP2013 |
| Inbound | All SharePoint Servers, but where Forefront Identity Management agent is installed | TCP/UDP 389 (LDAP service) | Active Directory | SP2010, SP2013 | |
| Inbound | All SharePoint Servers, but where Forefront Identity Management agent is installed | TCP/UDP 53 (DNS) | Active Directory | SP2010, SP2013 | |
| Inbound | All SharePoint Servers, but where Forefront Identity Management agent is installed | TCP/UDP 88 (Kerberos) | Active Directory | SP2010, SP2013 | |
| Inbound | All SharePoint Servers, but where Forefront Identity Management agent is installed | UDP 464 (Kerberos Change Password) | Active Directory | SP2010, SP2013 | |
| Inbound | All SharePoint Server (Depends on Central Admin config) | Office Server Web Services, TCP 56737, SSL 56738 | App (Central Admin) | SP2010, SP2013 | |
| Inbound | TS Jump point | RDP (TCP 3389) For Remote Admin | APP (Central Admin) | SP2010, SP2013 | |
| Inbound | Client IPs (as applicable) | TCP 80 or 443 | ISA Web Pub or WFE | SP2010, SP2013 | |
| Inbound | Index | TCP 80 or 443 | WFE | SP2010, SP2013 | |
| Inbound | Office Web Apps | 809 (private traffic between the servers that run Office Web Apps Server) | All Servers | SP2013 | |
| Outbound | ALL SharePoint Servers (Based on Authentication) | DNS (TCP/UDP 53) | DC (AD) /DNS (LDAP) | SP2010, SP2013 | |
| Outbound | External Content | DNS (TCP/UDP 53) | DNS | SP2010, SP2013 | |
| Outbound | ALL SharePoint Servers (Based on Authentication) | DS (TCP 445) | DC (AD) /DNS (LDAP) | SP2010, SP2013 | |
| Outbound | Index (File Shares) | Either NBT (TCP/UDP 137, 138,139) or Direct-hosted SMB (TCP/UDP 445) | Server Message Block (SMB) | External Content | SP2010, SP2013 |
| Outbound | ALL SharePoint Servers (Based on Authentication) | Kerberos (UDP 88) | DC (AD) /DNS (LDAP) | SP2010, SP2013 | |
| Outbound | ALL SharePoint Servers (Based on Authentication) | LDAP/S (UDP 389/636) | DC (AD) /DNS (LDAP) | SP2010, SP2013 | |
| Outbound | ALL SharePoint Servers (Based on Authentication) | RPC (TCP 135) | DC (AD) /DNS (LDAP) | SP2010, SP2013 | |
| Outbound | WFE (SSO) | RPC for SSO – (TCP 135), plus random high ports (Dynamic RPC) or restricted high ports (Static RPC) | APP Servers | SP2010, SP2013 | |
| Outbound | Index (Propagation) | Search Query, either NBT (TCP/UDP 137, 138,139) or Direct-hosted SMB (TCP/UDP 445) | Query | SP2010, SP2013 | |
| Outbound | WFE (Search Request) | Search Query, either NBT (TCP/UDP 137, 138,139) or Direct-hosted SMB (TCP/UDP 445) | Server Message Block (SMB) | Query | SP2010, SP2013 |
| Outbound | WFE (alerts) | SMTP (TCP 25) | SMTP/Exchange | SP2010, SP2013 | |
| Outbound | Index (BDC) | SQL (TCP 1433, UDP 1434) or custom port | External Content | SP2010, SP2013 | |
| Outbound | ALL SharePoint Servers | SQL (TCP 1433, UDP 1434) or custom port for Named SQL Instance | SQL Server Tabular Data Stream (TDS) | SQL Server | SP2010, SP2013 |
| Outbound | Index (Search Crawling) | TPC 80, TCP 443, TCP (custom) | HTTP | WFE | SP2010, SP2013 |
| Outbound | Index (Sites) | TPC 80, TCP 443, TCP (custom) | External Content | SP2010, SP2013 | |
| Outbound | WFE | TPC 80, TCP 443, TCP (custom) | HTTP | Index Server (search crawling) | SP2010, SP2013 |
Thursday, September 03, 2015
Binding a Gridview using Entity Framework from SQL Server
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class BindGridView : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if(!IsPostBack)
{
ContactsDataContext db = new ContactsDataContext();
dgvContacts.DataSource = db.Contacts1;
dgvContacts.DataBind();
}
}
}
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class BindGridView : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if(!IsPostBack)
{
ContactsDataContext db = new ContactsDataContext();
dgvContacts.DataSource = db.Contacts1;
dgvContacts.DataBind();
}
}
}
Search,Update and Delete using Entity Framework to SQL Server
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Update_EF : System.Web.UI.Page
{
Contacts obj = new Contacts();
ContactsDataContext db = new ContactsDataContext();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
ddlID.DataSource = db.Contacts1;
ddlID.DataBind();
ddlID.Items.Insert(0, new ListItem("Select First Name"));
}
}
protected void btnSearch_Click(object sender, EventArgs e)
{
int ID = int.Parse(ddlID.SelectedItem.Value.ToString());
Contacts con = db.Contacts1.SingleOrDefault(p => p.ID == ID);
txtFirstName.Text = con.FIRSTNAME;
txtLastName.Text = con.LASTNAME;
txtContactNumber.Text = con.PHONENUMBER;
lblMessage.Text = "Record Found";
}
protected void btnUpdate_Click(object sender, EventArgs e)
{
int ID = int.Parse(ddlID.SelectedItem.Value.ToString());
Contacts con = db.Contacts1.SingleOrDefault(p => p.ID == ID);
con.FIRSTNAME = txtFirstName.Text;
con.LASTNAME = txtLastName.Text;
con.PHONENUMBER = txtContactNumber.Text;
db.SubmitChanges();
txtFirstName.Text = "";
txtLastName.Text = "";
txtContactNumber.Text = "";
ddlID.SelectedIndex = 0;
lblMessage.Text = "Record Updated Successfully";
}
protected void btnDelete_Click(object sender, EventArgs e)
{
int ID = int.Parse(ddlID.SelectedItem.Value.ToString());
Contacts con = db.Contacts1.SingleOrDefault(p => p.ID == ID);
db.Contacts1.DeleteOnSubmit(con);
db.SubmitChanges();
ddlID.SelectedIndex = 0;
lblMessage.Text = "Record Deleted Successfully";
}
}
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Update_EF : System.Web.UI.Page
{
Contacts obj = new Contacts();
ContactsDataContext db = new ContactsDataContext();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
ddlID.DataSource = db.Contacts1;
ddlID.DataBind();
ddlID.Items.Insert(0, new ListItem("Select First Name"));
}
}
protected void btnSearch_Click(object sender, EventArgs e)
{
int ID = int.Parse(ddlID.SelectedItem.Value.ToString());
Contacts con = db.Contacts1.SingleOrDefault(p => p.ID == ID);
txtFirstName.Text = con.FIRSTNAME;
txtLastName.Text = con.LASTNAME;
txtContactNumber.Text = con.PHONENUMBER;
lblMessage.Text = "Record Found";
}
protected void btnUpdate_Click(object sender, EventArgs e)
{
int ID = int.Parse(ddlID.SelectedItem.Value.ToString());
Contacts con = db.Contacts1.SingleOrDefault(p => p.ID == ID);
con.FIRSTNAME = txtFirstName.Text;
con.LASTNAME = txtLastName.Text;
con.PHONENUMBER = txtContactNumber.Text;
db.SubmitChanges();
txtFirstName.Text = "";
txtLastName.Text = "";
txtContactNumber.Text = "";
ddlID.SelectedIndex = 0;
lblMessage.Text = "Record Updated Successfully";
}
protected void btnDelete_Click(object sender, EventArgs e)
{
int ID = int.Parse(ddlID.SelectedItem.Value.ToString());
Contacts con = db.Contacts1.SingleOrDefault(p => p.ID == ID);
db.Contacts1.DeleteOnSubmit(con);
db.SubmitChanges();
ddlID.SelectedIndex = 0;
lblMessage.Text = "Record Deleted Successfully";
}
}
Insertion into SQL Server using Entity Framework
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Insert_EF : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnSave_Click(object sender, EventArgs e)
{
Contacts obj = new Contacts();
obj.FIRSTNAME = txtFirstName.Text;
obj.LASTNAME = txtLastName.Text;
obj.PHONENUMBER = txtContactNumber.Text;
ContactsDataContext db = new ContactsDataContext();
db.Contacts1.InsertOnSubmit(obj);
db.SubmitChanges();
txtFirstName.Text = "";
txtLastName.Text = "";
txtContactNumber.Text = "";
lblMessage.Text = "Record Inserted Successfully";
}
}
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Insert_EF : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnSave_Click(object sender, EventArgs e)
{
Contacts obj = new Contacts();
obj.FIRSTNAME = txtFirstName.Text;
obj.LASTNAME = txtLastName.Text;
obj.PHONENUMBER = txtContactNumber.Text;
ContactsDataContext db = new ContactsDataContext();
db.Contacts1.InsertOnSubmit(obj);
db.SubmitChanges();
txtFirstName.Text = "";
txtLastName.Text = "";
txtContactNumber.Text = "";
lblMessage.Text = "Record Inserted Successfully";
}
}
Wednesday, September 02, 2015
Command to take backup of a single table in SQL Server
select * into NewTableName from SourceTable
Subscribe to:
Posts (Atom)