Prasad Bolla's SharePoint Blog

Click Here to go through the Interesting posts within my Blog.

Click Here to go through the new posts in my blog.

Wednesday, September 09, 2015

SharePoint 2007 Ports


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.

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();
        }
    }
}

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";
    }
}

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";
    }
}

Saturday, August 15, 2015

Windows 10 and Windows KeyBoard

Hi All,

Recently i runned intio an issue with Windows 10. the word p is not working.

I thought its an keyboard issue. After i performed windows update and restarted the machine again the letter P started working.

Regards
Prasad Bolla

Powershell Script to Change the Display Name in SharePoint 2007

First, we need to load up the SharePoint Assemblies
> [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
Then we connect to our site collection
> $site = New-Object Microsoft.SharePoint.SPSite("http://spsite")
Then we get the root web of the site collection
> $web = $site.RootWeb
We then need to connect to the User Information List, which corresponds to the UserInfo table.
> $list = $web.Lists["User Information List"]
And now we can select out the individual user record we want to update.  We’ll filter on the Account field, which should match our Active Directory user information.
> $user = $list.Items | where {$_["Account"] -eq "DOMAIN\User"}
If you look at the details of the $user object, you’ll see it has both a Name and DisplayName property.  Don’t be fooled, however, these fields are read only.  The one we want is Title.
So, lets update the Title value for this user and save the changes.
> $user["Title"] = "Lastname, Firstname"
 
> $user.update()
To check, I go back to the site and refresh the User Information List page – and sure enough, the updated value is applied.
Finally, then, we need to clean up after ourselves and dispose of the SharePoint objects.
> $web.Dispose()
 
> $site.Dispose()

Friday, August 07, 2015

How to restart more than one machine remotely

sometimes machines might be in hung state and you are unable to login into the machine.

In such scenario you can use shutdown -i

The command will give you the window. Now follow the process with that window.

Saturday, August 01, 2015

Command to change App Pool .Net Framework 4.5

Test is an App Pool Name already created with other version framework.

C:\>cd %windir%\System32\inetsrv

C:\Windows\System32\inetsrv>appcmd set apppool /apppool.name: Test /managedRunti
meVersion:v4.5
APPPOOL object "Test" changed

C:\Windows\System32\inetsrv>