How to create custom SharePoint 2013 list using PowerShell?

don't be selfish...Share on FacebookShare on Google+Share on LinkedInShare on RedditTweet about this on TwitterEmail this to someonePrint this page

SharePoint provides an interface called AddFieldAsXml. This basically creates a field based on the specified schema. Nothing fancy. Right?

However, this can be very handy when you want to create your own custom lists in SharePoint programmatically. I will be using PowerShell as an example to demonstrate how you can simply create SharePoint Lists based on plain, simple xml definitions.

To start with, I created an xml template based on which I want to create my custom list using PowerShell.


<?xml version="1.0" encoding="utf-8"?>
<Template>
	<Field Type="Text" DisplayName="Name" Required="False" MaxLength="255" StaticName="Name" Name="Name" />
	<Field Type="Number" DisplayName="Phone Number" Required="False" MaxLength="255" StaticName="PhoneNumber" Name="PhoneNumber" />
	<Field Type="DateTime" DisplayName="Date of Birth" Required="False" MaxLength="255" StaticName="DateOfBirth" Name="DateOfBirth" /> 	
	<Field Type="Choice" DisplayName="Annual Salary" Required="False" Format="Dropdown" FillInChoice="FALSE" StaticName="AnnualSalary" Name="AnnualSalary">
            <Default>0 - 10000</Default>
            <CHOICES>
                <CHOICE>0 - 10000</CHOICE>
                <CHOICE>10000 - 50000</CHOICE>
                <CHOICE>50000 - 100000</CHOICE>
                <CHOICE>100000 or more</CHOICE>
            </CHOICES>
       </Field>	
</Template>

In this example, I have used Text, Number, Date and Choice as the Field Types. But this could be anything which is supported by SharePoint or even your own content types. Check the documentation on MSDN for Field Element.

Next step is to read this xml file, parse it and use the AddFieldAsXml method to create fields in this list. The PowerShell snippet below does the trick. Straight and Simple. Isn’t it?


Add-PSSnapin Microsoft.SharePoint.PowerShell 

function CreateList($siteCollectionUrl, $listName, $templateFile){
	
	$spWeb = Get-SPWeb -Identity $siteCollectionUrl 
	$spTemplate = $spWeb.ListTemplates["Custom List"] 
	$spListCollection = $spWeb.Lists 
	$spListCollection.Add($listName, $listName, $spTemplate) 
	$path = $spWeb.url.trim() 
	$spList = $spWeb.GetList("$path/Lists/$listName")
	$templateXml = [xml](get-content $templateFile)
	foreach ($node in $templateXml.Template.Field) {
	
		$spList.Fields.AddFieldAsXml($node.OuterXml, $true,[Microsoft.SharePoint.SPAddFieldOptions]::AddFieldToDefaultView)
	}
	$spList.Update()
}


$siteCollectionUrl = "http://manas.com"
$listName = "New Custom List"
$templateFile = "template.xml"

CreateList $siteCollectionUrl $listName $templateFile

And here is the result, just by configuration in xml file you can create lists using PowerShell.

SharePoint Create List

Download Example

Happy Coding!

don't be selfish...Share on FacebookShare on Google+Share on LinkedInShare on RedditTweet about this on TwitterEmail this to someonePrint this page


How to pass Professional Scrum Master (PSM I) Certification?

don't be selfish...Share on FacebookShare on Google+Share on LinkedInShare on RedditTweet about this on TwitterEmail this to someonePrint this page

So, Finally, I am a Professional Scrum Master (PSM I)

Scrum Master Badge

It was kind of overdue to have an attempt on Professional Scrum Master Certification conducted by Scrum.org. I have been using Agile (and Scrum) in my projects in various capacities for many years now. And to be honest, the simplicity of the framework and the empirical process behind the Scrum has fascinated me to pursue the subject further.

I registered for the exam last week. The process is relatively simple. Register on the Scrum.org and pay $100 for the PSM I exam. They would send your password to access the exam within a business day. And you have a period of 14 days to give the exam. I kind of used 7 days just to make sure I don’t waste my $100 as the score you need to get is fairly high (85%). That means from a set of 80 questions, you need to get at least 68 right.

PSM

I did not do excellent and just made sure to pass the exam on border by having 69 answers correct i.e. 86.6 % as score. Well, not really bad for first attempt. After the exam, you do not get report of the question which you did not answer correct but you do get a consolidated report on the areas with your scores. Mine looked something like this. This at least helps me to focus on specific areas for Scrum.

Scrum Score

Tips and tricks to pass Professional Scrum Master Certification

Let’s be honest, there is no ready-made formula for success in any field and same applies here while you try to attempt get the certificate for Professional Scrum Master. And in fact, the certificate value just drops to nothing if you have not learned anything during the process.

Nevertheless, here are my two cents based on my own experience.

  1. Make sure you go through the official Scrum Guide written by Ken Schwaber & Jeff Sutherland thoroughly. The guide is very concise, but covers the essence of Scrum.
  2. I would suggest you to go through the Scrum Open Assessments (both and Scrum Master and Scrum Developer) multiple times before you are scoring 95% or more consecutive time. The open assessment has a set of approximate 40 questions. Out of which 30 questions are presented in an assessment.The assessment will give you an idea of questions which would be asked in the actual assessment. Additionally, you would find some of the questions from open assessment repeated in the actual assessment. This gives you surplus time and confidence during the examination.Personally, I found 10-15 questions being repeated in the actual exam.
  3. Don’t look around on internet for dumps of questions. You are not going to find any. And even if you do, then what’s the point of giving exam and get credentials? You could better create a Photoshop version of certificate to boss around.
  4. Everyone has their own preference over books, I went through the ‘A Guide to the SCRUM BODY OF KNOWLEDGE (SBOK™ GUIDE), 2013 Edition’. It’s to the point and gives you decent read before the exam.
  5. Go through the discussions on Scrum Forum. You would find a lot of people discussing their experience and queries on this forum. Group of folks here are willing to help you if have questions.  A great place to hang around for Scrum enthusiasts.
  6. During the exam, don’t try to Google (or Bing) around for the answers. First, you won’t find any. Second, there is no guarantee that the answer is right. Third, you would be wasting your time. Keep in mind that you need to complete 80 questions in 60 minutes. That gives you 45 seconds per question. Yes, you need to be fast.
  7. And yes, make sure you have an isolated place where you can concentrate while giving the examination. As the examination is online, you need to have a good and consistent internet connection in place. Have a glass (or two) of water with you. You would feel thirsty during the exam. Psychological? Not sure!

Good luck to those of you who are preparing and attempting for PSM!

And while you are here, you can read my earlier related posts on Scrum and Agile.

A beginner’s guide to Scrum

The curious case of Scrum Master’s role

An introduction to Agile Methodology

A beginner’s guide to various Software development methodologies

don't be selfish...Share on FacebookShare on Google+Share on LinkedInShare on RedditTweet about this on TwitterEmail this to someonePrint this page


Error during configuration of Scheduled Backups for Team Foundation Server

don't be selfish...Share on FacebookShare on Google+Share on LinkedInShare on RedditTweet about this on TwitterEmail this to someonePrint this page

Another situation which should be easy and straight forward, but then you realise that it does not work.

I wanted to set up my own Team Foundation Server Express (yes, it’s light, free version with certain limitations but a good way to start for your small team or organisation). The installation process is quite straight forward and clear.

However when I wanted to configure the scheduling for back-ups of my TFS database, I was continuously receiving the error below.

TF401009: The TFS service account NT AUTHORITY\LOCAL SERVICE cannot access network shares. Change to an account that can access the backup path.

TF400997: SQL Server service is running as NT AUTHORITY\NetworkService. Please change this account to an account that can be granted permission on the backup path.

Untitled

I had given the permissions to both the accounts on the network share. Actually, it was shared folder on the same machine as I installed the TFS in single server mode.

To add a bit of background, my Team Foundation Service was running under Local Service and SQL Server was running under Network Service. This is the reason why these two accounts come into picture.

Looking at the logs, it was more clear that for scheduling backups TFS expects the proper (preferably service) accounts to be used to run SQL Server and Team Foundation Service. The following error messages can be seen in the log.

Verify that account ‘NT AUTHORITY\NetworkService’ is not local service or local system.
Node returned: Error
TF400997: SQL Server service is running as NT AUTHORITY\NetworkService. Please change this account to an account that can be granted permission on the backup path.

And a similar one for TFS Service as well.

Resolution:

The resolution is to change the Service account for both SQL Server (MSSQLSERVER) and TFSJobAgent (Visual Studio Team Foundation Background Job Agent) to another account.

Capture

However, this seems to be check only during the configuration. And if you change the service log on user back to Network and Local Service after configuration, the backup procedure still runs without any hassle.

Not sure about the details why this is prevented during configuration. If you are aware of the reason, please share!

don't be selfish...Share on FacebookShare on Google+Share on LinkedInShare on RedditTweet about this on TwitterEmail this to someonePrint this page


Setup your SharePoint 2013 Farm in Microsoft Azure with just a few clicks

don't be selfish...Share on FacebookShare on Google+Share on LinkedInShare on RedditTweet about this on TwitterEmail this to someonePrint this page

Windows Microsoft Azure recently announced the feature where they explained the ability to create a full blown SharePoint Farm environment for either development or actual production use.

With SharePoint Server Farm, the Microsoft Azure Preview Portal automatically creates a pre-configured SharePoint Server 2013 farm for you. This can save you a lot of time when you need a basic or high-availability SharePoint farm for a development and testing environment or if you are evaluating SharePoint Server 2013 as a collaboration solution for your organization.

Further documentation is available on Microsoft Azure site

SharePoint Farm in Azure (8)

Creating a SharePoint 2013 Farm in Microsoft Azure is literally a couple of clicks away. The new option provides a new template along with others (such as Ubuntu, SQL Server Standard 2014 etc.) for creating a SharePoint Server Farm.

SharePoint Farm in Azure (1)

The next step after selecting the SharePoint Server template is to provide the necessary mandatory fields such as Resource Group, Default User Name and Password.

SharePoint Farm in Azure_(2)

Azure Resource Manager allows you to group multiple resources as a logical group which serves as the lifecycle boundary for every resource contained within it. Typically a group will contain resources related to a specific application.

And that’s actually it. Literally and just two clicks in Azure Portal, you have a working SharePoint Server Farm ready for use. If you select the resource group in Azure Portal, you would see something like this and following resources (VMs, Virtual Network etc.) would have been created for you.

SharePoint Farm in Azure (9)

Optional

Of course, you can further fine tune the default setup by changing the default host name prefix, administrator account, passwords, MSDN Subscription for Azure or even the location of resources or affinity group.

Domain Controllers

SharePoint Farm in Azure (3)

SQL Servers

SharePoint Farm in Azure (4)

SharePoint Servers

SharePoint Farm in Azure (5)

Other Configuration

SharePoint Farm in Azure (6)

Location

SharePoint Farm in Azure (7)

Enjoy your new SharePoint Environment!

don't be selfish...Share on FacebookShare on Google+Share on LinkedInShare on RedditTweet about this on TwitterEmail this to someonePrint this page


A beginner’s guide to Performance Control Systems

don't be selfish...Share on FacebookShare on Google+Share on LinkedInShare on RedditTweet about this on TwitterEmail this to someonePrint this page

(Juran & Godfrey, 1999, p. 4.9) acknowledged that control subjects run to large numbers, but the number of “things” to be controlled is far larger. There is no possibility for upper managers to control huge numbers of control subjects. Instead, they divide up the work of control, using a plan of delegation somewhat as depicted in figure below. This division of work establishes three areas of responsibility for control: control by nonhuman means, control by the work force, and control by the managerial hierarchy.

Figure: The pyramid of control. Making Quality Happen, Juran Institute, Inc.

Various authors have tried to explain control in light of different meanings. (Tannenbaum, 1968, p. 239) referred it as any process in which a person or group of persons or organization of persons determines, i.e., intentionally affects, what another person or group or organization will do.

However, (Ouchi, 1979, p. 833) considers a more simple minded view of organizational control stated in the following two questions: What are the mechanisms through which an organization can be managed so that it moves towards its objective? How can the design of these mechanisms be improved, and what are the limits of each basic design?

(Tannenbaum, 1968, p. 246) noted that variations in control patterns within organizations have important and in some cases quite predictable effects on the reactions, satisfactions and frustrations, feelings of tension, self- actualization, or well-being of members.

(Ouchi, 1979, p. 834) classified that organizations have three control mechanisms:

Market control


Market control system focuses on output target as it is more effective to evaluate the work after it has been completed. In order to use a market control system effectively, there must be a certain level of information and clearly set targets to make it possible to evaluate the output.

Bureaucratic control

The fundamental mechanism of control involves close personal surveillance and direction of subordinate by supervisor. The information necessary for the completion is contained in rule; these may be rules concerning processes to be completed or rules which specify standards of output or quality.

Clan Control

The clan control system is based on cultural values, shared norms, informal relationships and beliefs that coordinate the behaviour to achieve organisational targets.

(Johnson, et al., 2008, p. 10) categorises controls as:

Strategic control

involves monitoring the extent to which the strategy is achieving the objectives and suggesting corrective action.

Operational control

is what managers are involved in for most of their time. It is vital to the success of strategy, but it is not the same as strategic management.

Performance Control Tools


“I often say that when you can measure what you are speaking about, and express it in numbers, you know something about it; but when you cannot measure it, when you cannot express it in numbers, your knowledge is of a meager and unsatisfactory kind.
If you can not measure it, you can not improve it.” – Lord Kelvin

Benchmarking


(Slack, et al., 2010, p. 611) defined benchmarking as the process of learning from others and involves comparing one’s own performance or methods against other comparable operations. It is a broader issue than setting performance targets, and includes investigating other organizations’ operations practice in order to derive ideas that could contribute to performance improvement. Further, the stressed that Benchmarking is essentially about stimulating creativity in improvement practice.

(Spendolini, 1992) defined benchmarking as continuous, systematic process for evaluating the products, services, and work processes of organizations that are recognized as representing best practices for the purpose of organizational improvement.

(Camp, 1994) on the other hand described benchmarking as the continuous process of measuring products, services, and practices against the company’s toughest competitors or those companies renowned as industry leaders.

Benchmarking is not about imitating another organization. It is or should be more about innovation and improvements than about copying a competitor. Benchmarking should facilitate learning and understanding organizational processes and results.

There are various types of benchmarking, some of them are listed as follows. Organisations can decide to use one or a combination of different types to meet their goals.

  1. Internal benchmarking

    is a comparison between operations or parts of operations which are within the same total organization.

  2. External benchmarking

    is a comparison between an operation and other operations which are part of a different organization.

  3. Non-competitive benchmarking

    is benchmarking against external organizations which do not compete directly in the same markets.

  4. Competitive benchmarking

    is a comparison directly between competitors in the same, or similar, markets.

  5. Performance benchmarking

    is a comparison between the levels of achieved performance in different operations.

  6. Practice benchmarking

    is a comparison between an organization’s operations practices, or way of doing things, and those adopted by another operation.

(Spendolini, 1992) came up with a generic model for benchmarking with the following five steps being involved:

  1. Determine what to benchmark.
  2. Form a benchmarking team
  3. Identify benchmark partners.
  4. Collect and analyse benchmark information.
  5. Take action (and continue the process)

(Juran & Godfrey, 1999) presented the following 10-step process for conducting a benchmarking investigation consists of the following five essential phases:

  1. Planning
  2. Analysis
  3. Integration
  4. Analysis
  5. Maturity

Figure: The formal 10-step benchmarking process.

Balanced Scorecard


(Kaplan & Norton, 1992) suggested what you measure is what you get. They introduced the balanced scorecard in 1992 and believed that measurement was as fundamental to managers as it was for scientists. If companies were to improve the management of their intangible assets, they had to integrate the measurement of intangible assets into their management systems. While formulating the balanced scored, they emphasised on the aspect that the Balanced Scorecard does not become a benchmarking exercise. (Kaplan, 2010, p. 19) acknowledged that even high-performing companies succeeded with strategies that were quite different from each other.

 

Figure: Balanced scorecard developed by Kaplan and Norton (1992)

The figure above shows the original structure for the Balanced Scorecard which retains financial metrics as the ultimate outcome measures for company success, but supplements these with metrics from three additional perspectives – customer, internal process, and learning and growth – that we proposed as the drivers for creating long-term shareholder value.

(Lipe & Salterio, 2000) described the balanced scorecard as an integrated set of leading and lagging performance measures designed to capture the organisation’s strategy.

Various authors such as (Johnson, 1980) have argued that companies should focus on improving quality, reducing cycle times, and improving companies’ responsiveness to customers’ demands. Doing these activities well, they believed, would lead naturally to improved financial performance.

However, (Jensen, 2001) stated that Balanced Scorecard theory is flawed because it presents managers with a scorecard which gives no score – that is no single-valued measure how they have performed. Thus managers evaluated with such a system have no way to make principled or purposeful decisions.

(Bloomfield, 2002) noted that automation is essential in order to manage the vast amount of information related to a company’s mission and vision, strategic goals, objectives, perspectives, measures, causal relationships, and initiatives. The alternative is a manual process, which significantly increases the effort and cost of scorecard development and sets back progress in the early stages of the balanced scorecard development, when momentum is critical.

don't be selfish...Share on FacebookShare on Google+Share on LinkedInShare on RedditTweet about this on TwitterEmail this to someonePrint this page