Powered By Blogger

Jul 30, 2012


Intercloud

This blog post is about some basics of Intercloud. Basically a private cloud is a private data center with servers set up in such a way that one’s company can efficiently operate using load balancing and scale to maintain computing needs. An InterCloud can be simply defined as a network of private clouds.

The Internet can be defined as a public cloud. Anyone can link up to the Internet at anytime. A private cloud may be the Internet on a small scale but the main difference is it is not available to anyone. It is available only to authorized people who have access to the private space. For an example if you have a large enterprise then you might set up private clouds for several departments or divisions and link them together. Then you will have an Intercloud.

The Intercloud concept is based on the key issue that each single cloud is not having sufficient physical resources. If a cloud oversupplied the computational and storage resources, it could not be able to satisfy further requests for service allocations by its clients. The Intercloud addresses such issues. Basically each cloud can use the computational and storage resources of other clouds by using the pay-for-use method.

Intercloud is similar in concept to Internet model. Intercloud is a an open multiple infrastructure provider where applications need not to be tightly coupled into any specific cloud. The idea of Intercloud is to provide open interfaces for vendors such that there is a facility for all interconnected clouds to have a common control of how applications should be deployed. There is a common protocol and exchange mechanism for each cloud. 







Jul 28, 2012


What is Cloud Computing?

In this blog post I’m presenting some basics about Cloud Computing. According to wiki Cloud Computing is “Internet Based computing, whereby shared resources, software and information are provided to computers and other devices on demand, like the electricity grid”. In simple terms Cloud Computing is the process of taking the services and tasks performed by the computers and bringing them to the web.
When considering the basic elements of Cloud Computing, it consists of
  • SAAS –Software as a Service
  • PAAS –Platform as a Service
  • IAAS – Infrastructure as a Service


 SAAS
The concept behind SAAS is renting software from a service provider rather than buying it by ourselves. This is the most popular type of cloud computing. The software is hosted on centralized network server which available over the internet. Google docs, Yahoo mail, CRM applications are instances of SAAS.
Some benefits of SAAS can be listed as below.
  • This saves money since we don’t need to buy servers or other software.
  •  SAAS applications are available from any computer or any device, anytime and anywhere.
  • User need not to worry about the installation or upgrades.
  • Flexibility and Scalability.

PAAS
PAAS provides a development platform for developers. The end user writes own code and the PAAS provider uploads that code and presents it on the web. Basically PAAS provides services to develop, test, deploy, host and maintain applications and also it provides some support for the creation of applications as well. The PAAS provider manages upgrades and system maintenance.
There are four types of PAAS solutions namely social application platforms, raw compute platforms, web application platforms and business application platforms. Facebook is a type of social application platforms where third parties can write new applications that are made available to the end users. CRM solutions are examples for business application platforms. When consider raw compute platforms the best example is Amazon’s infrastructure where the developers can upload and execute their applications. Google provides APIs to developers to build web applications and they can be categorized as web application platforms.
Some benefits of PAAS can be listed as below
  • Reduce the complexity and cost.
  • Provides hosting capabilities and the facilities required to support the complete life cycle of building web applications.
  • Provides services such as web service integration, database integration, security, scalability, application versioning etc.


IAAS
This is the delivery of computer infrastructure as a fully outsourced service. Google, IBM, Amazon.com are some of the companies which provide infrastructure services. Managing hosting and development environments are the basic services of IAAS.  The user can buy the infrastructure at any particular time according to the requirement instead of buying the infrastructure that might not be used for some time. Basically the user pays only for what they are using this is also known as “Pay as you go” model.   For a small business one of the most difficult things is to keep capital expenditure under control. By moving the infrastructure to the cloud, we can have the ability to scale as if we owned our own hardware and data center. IAAS is also referred as HAAS (Hardware as a Service)  
Some benefits of IAAS can be listed as below.
  • Dynamic scaling.
  • Usage based pricing.
  • Access to superior IT resources.
  • Reduce cost.
  • Maximum flexibility.

Basically SAAS offers a complete application as a service and PAAS offers the ability to develop an application where IAAS doesn’t care about the application at all. If we have already written the code or have the software package which we want to install and run in the cloud then we go for IAAS. When we have no software or want to build something from scratch to solve a problem where there are no packages or they are too expensive then we go for PAAS.  The three basic elements of cloud computing have a great effect on the IT operations. 

Jul 27, 2012


Commands in PowerShell


This post describes the commands used in PowerShell. Basically there are four types of commands as listed below.



  • Cmdlets
  • Functions
  • Native
  • Scripts


Cmdlets

Cmdlets (pronounced as command-let) support a normalized naming scheme with the verb-noun syntax. PowerShell has built-in cmdlets such as get-process, get-help and where-object. Developers also can create new cmdlets and register them with the PowerShell host. 



Functions

When the commands and statements are organized into a reusable chunk of code we name it as functions.



Native

Native commands run outside the PowerShell process. They are very simple. When you open a .doc file in Microsoft Word you are using a native command.



Scripts


Scripts let us save a commonly used set of commands to a file. Normally scripts have .ps1 extension.

Scripts are called from PowerShell by file name. If your PowerShell’s current location is the same as the location of the script you can execute the script by placing a “./”  in front of the script name.

Scripts will not run by default. PowerShell allows you to set a script execution policy. To set the Execution Policy
1. Type set-executionpolicy -ExecutionPolicy Unrestricted

2. Click Enter to execute.



Jul 26, 2012


PowerShell - Special Characters


This blog post is about special characters and tokens that we can use in PowerShell. I have listed  some of them and use of those characters and tokens with examples


  • $ : This Dollar mark use to declare a variable
      Eg: $number = "333"


  • $?: The Dollar mark and the question mark together use to indicating whether the previous command has an error or not by returning 'True' of 'False' as the output.
      Eg: See if a PowerShell cmdlet is existing in the system



  • | : The pipeline uses to get the output of the first command and pass it to another command to get the result.
      Eg: Get a list of processes and display the first 5 processes of the list



  • .. : Double dots use to specify a range. This can be use instead of foreach loop
      Eg: print numbers from 1 to 10 (1..10)



  • :: : The double colon use to refer a static member of a class
      Eg: Compare the two numbers "22" and "33" and gives 'False' as the output


  • % : The percentage mark acts as the MOD 
      Eg: 5%2 gives 1 as the output

  • ? : Question mark gives all the items which confirm the condition. This is same as 'where' 
     Eg: Print odd numbers between 1to 5




  • # : Single line comment
      Eg: #This is a single line comment


  • <# .. #> : This is for Multi- line comment
     Eg: <# this is a
           Multi-line
           comment#>


  • & : Ampersand use to execute a string as command
     Eg: & "Get-Process"






Jul 24, 2012


SharePoint 2010 - DisplayName, InternalName and StaticName


This blog post describes about the different names called “DisplayName, InternalName and StaticName” which use to refer a field. SharePoint uses these three different names and sometimes we face a problem of selecting the correct one.

DisplayName    : This is the name what you see in the site.

InternalName   : This name is the name you get for a field when you created it for the first time. This can’t be modified and it’s a read only name. This name should be a unique name.

StaticName       : This name doesn’t need to be unique and this can be changed. If you don’t change the StaticName then the InternalName and the StaticName are the same.

Let’s assume that there is a site in English and French versions. In this case the names of the items are different based on the language. So if we use the DisplayName of an item in English site inside the code to access the item, when we deploy the WSP file an error will occur in French site. The reason is the DisplayName is different in French site.

So the best way to solve this issue is, you should always use the InternalName inside the code since the WSP changes are valid for both English and French sites. (InternaName of the French site should be as same as the English site)
var value = ListItem[InternalName]

So which name to use and when?

If you need to access custom field created by your own team then you can use the DisplayName. If you are using any SharePoint provided field then better to use StaticName or InternalName, since you are not sure if the DisplayName will be changed or not.

Jul 21, 2012


PowerShell - Various Tasks


In this blog post I'm presenting some of the tasks which you can experiment using PowerShell.


  • Write on the screen: You can use ' Write-Host' to write the Output on the screen and use                 ' -foregroundcolor ' to add a color to the text


  • Get input from the user: You can use ' Read-Host ' to get an input text from the user


  • Sleep: You can use ' Start-Sleep ' to display a certain text after some time. This takes seconds by default



  • Retrieve the date : Use ' (get-date) ' to get the current date and time




  • Get a list of directories: You can simply use ' dir ' to list the directories 





Jul 18, 2012


Backup & Restore a SharePoint Site Collection


In this blog post I'm going to explain how to backup and restore a SharePoint site collection.

Backup a SharePoint site collection


First go to the SharePoint Central Administration 2010. Then select Backup and Restore under Central Administration. Next click on Perform a site collection backup under Granular Backup.



Then select the site collection and give the path of the folder which you wish to include your backup and a name for the backup with .bak extension. Make sure that the folder is write privileged. Select the Overwrite existing file check-box if a backup file with the same name is located in the current folder.

Then click Start Backup. Then you will get the Granular Backup Job status. Click Refresh button to confirm that the Status is 'No operation in progress'.

Then you will see the backup file has created inside the located folder.


By following these steps you can get an entire site collection backup, contains all files and settings. If you have any custom Web Pats in the site collection you need the WSP file for the restoring process.


Restore a SharePoint site collection


First go to the SharePoint Central Administration 2010 and then select Manage web applications under Application Management.



Then create a New web application and get the path of that web application.

In order to restore the backup into that web application you need the SharePoint 2010 Management Shell. Then Run as the administrator and type the following command.


restore-spsite -identity http://sp-sohani:44444/ -path C:\SPBackup\Site.bak

Then you will get a message asking the restore options, then type 'A' and press enter


Now the restoring process is over but you might not be able to access the site since the Administrator is different. In order to change the administrator, go to the SharePoint Central Administration 2010 and select Application Management. Then click on the Change site collection administrator under Site Collections.



Then select the site collection and change the Administrator.

Now you can access the site with the administrators account.


Jul 12, 2012



Delete Web Applications and Site Collections using SharePoint 2010 Management Shell


This blog post describes how to delete Web applications and Site Collections using SharePoint 2010 Management Shell.

Delete a Site Collection

First you have open the SharePoint 2010 Management Shell. Make sure that you run the program as the Administrator.

We use the command Remove-SPSite to remove the site. Then give the URL of the site collection which you wish to delete.



Then you will get a confirmation window asking  whether you want perform this action or not. Then insert "A" to confirm.



Now the Site collection has successfully deleted. If you try to access the site then you will get an error message like below.



Delete a Web Application

Before you delete a Web Application you should satisfy the below mentioned requirements.

1. You should be a member of the local administrators group on the computer's running Central Administration.
2.If you want to delete the content databases associated with the Web Application then you need to have the SharePoint_Shell_Access role within this content databases.

We use the command  Remove-SPWebApplication to remove the web application. Then give the site name.


Then you will get a confirmation window asking whether you want perform this action or not. Then insert "A" to confirm.


This command will not delete the content databases. If you want to delete the Content databases use the command Remove-SPContentDatabase.


Then you will get a confirmation window asking whether you want perform this action or not. Then insert "A" to confirm.



Jul 6, 2012



Create a SharePoint List definition using c#


This blog post describes an easy way to create a List definition using Microsoft Visual Studio 2010.

First you have to open a List Definition Project in Visual Studio. I have named it as 'ListDefinitionProject1'


Then give the Site name and select 'Deploy as a sandboxed solution'.



Then select 'Custom List' as the list definition type.



Now the solution Explorer will look like as shown below. Then open the Elements.xml file.
(ListDefinition1 -> ListInstance1 -> Elements.xml)


Then edit the Title and the URL as shown below.

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <ListInstance Title="MyList1"
                OnQuickLaunch="TRUE"
                TemplateType="10000"
                Url="Lists/MyList1"
                Description="My List Instance">
  </ListInstance>
</Elements>


Finally Build and Deploy the solution.Then you can see the new List called "MyList1" has created inside the SharePoint site under the Lists.



Now you can add fields to the above created List.
Open the Schema.xml file and within the <Fields></Fields> tag you can add the fields as preferred.

 <Fields>
      <Field Type="Note" Name="ListName" DisplayName="Name" Required="FALSE" ID="{1D54AAC6-DBB8-4454-91B7-E2FAE7697D6A}">
      </Field
    </Fields>


Then inside the ViewFields section of the second View add the FieldRef node as shown below.


<FieldRef Name="Name"></FieldRef>



Now the field 'Name' is visible in the 'MyList1' List.


Jul 4, 2012


Create a SharePoint Document Library using c#

This blog post describes how to create a SharePoint Document Library using c#.  Its a very simple process.


First you should create a SharePoint console application project using Microsoft Visual Studio 2010.Name the project as 'DocumentLibraryCreation'.





Then insert the below code within the main method. Make sure to input the correct 'Site name'. You can and a name for the Document Library and a template type as preferred.


using (SPSite site = new SPSite("http://sp-sohani:8118/sites/Gouri_Sohani/"))
            {
 
                using (SPWeb web = site.OpenWeb())
                {
 
                    SPListTemplate listTemplate = web.ListTemplates["Document Library"];
 
                    SPDocTemplate docTemplate = (from SPDocTemplate dt in web.DocTemplates
 
                                                 where dt.Type == 122
 
                                                 select dt).FirstOrDefault();
 
                    Guid guid = web.Lists.Add("My Document Library""My Documents", listTemplate, docTemplate);
 
                    SPDocumentLibrary library = web.Lists[guid] as SPDocumentLibrary;
 
                    library.OnQuickLaunch = true;
 
                    library.Update();
 
                }
  
            }


Now run the application and you can see the new Document Library called ' My Document Library' has created inside the SharePoint site under Document Libraries.




This is a list of Document Templates available in SharePoint 2010.



















Jul 2, 2012




Delete User Alerts from SharePoint Site Collection 


SharePoint users often subscribe to the alerts on any lists or libraries of the site. This blog post describes how to remove those alerts from the entire Site Collection. One of the benefits of removing unwanted alerts is that you can protect the mail server from being overloaded.


This is a very simple process.


First open the site and then go to Site Actions and then select Site Settings.



Then select User alerts under the Site Administration category






Then select the user from the drop down and then you will see the list of alerts for that person






Then select the alerts which you want to remove and click on 'Delete Selected Alerts'. Now you have successfully removed the User Alerts from the SharePoint Site Collection.

Jul 1, 2012


SharePoint Hierarchy...


This blog post briefly describes about the SharePoint Hierarchy. This includes steps of creating Web Applications and Site Collections using SharePoint Central Administration as well.

Here is the basic SharePoint Hierarchy
                     1. Server Farms
                     2. Web Applications
                     3. Site Collections
                     4. Sites
                     5. Lists, Libraries, Web Parts etc.


Server Farms are at the top of the hierarchy. This includes all physical servers that comprise your SP installation. It consists of one or more SP servers and one or more SQL servers and they are bound together by a single configuration database in SQL. When you run the SP configuration wizard after installing MOSS/WSS you either create a new server farm or connect to an existing one.

Once you have your server farm you should create a Web Application.  This creates a website in IIS (Internet Information Services) to host the site. When you create a Web Application, websites are getting an application pool and other IIS properties. You can create multiple web applications on a server farm.

Inside a Web Application you have to create a Site Collection. You can create multiple Site Collections inside a Web Application. It is a collection of sites and you can define a top level site.

Now you have a Site Collection and a top level site. You can have multiple sites under the top level site. Sites are SharePoint interfaces seen by the users.

Site includes content inside it. This includes Lists, Libraries, Web Parts, etc.


Create a Web Application using Central Administration


First you should open the SharePoint 2010 Central Administration. Go to the start menu , then go to All Programs and select  SharePoint 2010 Central Administration under Microsoft SharePoint 2010 Products. Make sure to run the program as administrator.


Then go to Application Management and select Manage web application under the Web Applications category


Then select the New button on the ribbon.



Then fill the form and create a Web application


Example:




Create a Site Collection using Central Administration

First you should open the SharePoint 2010 Central Administration. Go to the start menu , then go to All Programs and select  SharePoint 2010 Central Administration under Microsoft SharePoint 2010 Products. Make sure to run the program as administrator.

Then go to Application Management and select Create site collections under the Site Collections category



then select the Web Application, add fill the Title, Description, URL. Then select a Template and add Primary Administrator using the format <Domain>\<Username>

Example: