Howdy! Welcome to my blog. I'm Cheng, and the objective of setting up this blog is to share stuff that I've learnt throughout my SharePoint journey. Stories that I shared here may or may not be of applicable to you today but please do come back should you encounter the same in future =)

VMWare Workstation

Install VMWare Workstation on to your local PC, Ensure that your local PC has got at least 8 gb RAM. You would need to allocate some of the RAM to your 2012 server later.

Once completed the Workstation installation (i would not go through how you install software as it is simple), create a “New virtual machine“, choose Typical installation, PLEASE select option “I will install the operating system later“, else you will encounter error later. Then click Next until the vm files are created in your document folder “Documents\Virtual Machines\Windows Server 2012”

Windows Server 2012

There is nothing much crucial to explain here. Just follow the setup wizard.

Once completed, you will be asked to enter the administrator password bla bla bla.

Remember to rename your windows name to something meaningful.. NOT Something like win-is2xx92243d which is totally making no sense. To configure this, go to Server Manager > Local Server > Click Computer Name > Change > Rename your server and click OK.

Restart your computer.

Next, it is always good to set your Server IP address. Though this is not actually required for a Single Box Setup. But good to learn? =) then

Next is to setup Active Director Domain Services (AD DS), this is required for you to create services account for sharepoint and sql later on. Note! dcpromo.exe isdeprecated for windows 2012. Sadly.

Click Next all the way down until you see “Install” button. Kindly ignore those warning message. Click Install. Reboot and you are done with DC Promo.

Service Account

Now that your DC is up, you would need FEW accounts to setup your SharePoint 2013 environment. Note that i did not mention how many account required, because, ultimately, it depends on how segregated you want your farm to be. For Single Box solution and Less Error Prone. You may only need 3 accounts.

Next, select Role Mode. For evaluation purpose, i select All features with default.

Name your SQL Instance

Specify your services account. In my case, i use “SQL Server service account” that i have created previously.

Specify the Admin Account using the same SQL Server service account. account. (Well, this is for evaluation, you can still opt to use other account)

Analysis Configuration – Specify the same service account.

Distributed Replay Controller – Specify the same service account and the Controller Name as your Server Name

Click NEXT, NEXT, NEXT to install.. go get a coffee and come back after 30 mins…

..

OK~ Next thing is to setup permission for SharePoint Setup Account. Base on the article above. You have to grant the account (In my case “spsetup”) DBCreator and SecurityAdmin permission.

At this time, your server only allow Windows Authentication mode to access to your Database Engine. Please kindly Grant the SQLService account with Local Administrator right temporary. Log Off and switch to this account.

For SharePoint 2013, there is one additional step is to change the Max Degree of parallelism to 1. Go to Database Engine, Right Click and Select Property. Under Advanced panel. Change the value to 1.

Click OK to proceed. Once this is completed, you may Switch User back to SharePoint Setup Account now (via Alt + Del + Insert) Note: Remove the SQLService account from local admin group once you are done with setting up the permissions.

SharePoint 2013

Map your SP2013 iso file to your virtual machine (if you haven’t)

Go into your vm and install SP2013 pre-requisites. The next few steps are for Offline Pre-requisite installation.

Run Powershell with Administrator rights. Ensure you have executed the following command before Set-ExecutionPolicy RemoteSigned

Run the following command. Make sure the path is where you store the pre-requisite files. Also, copy the “prerequisiteinstaller.exe” from your SP2013 iso to the same folder where your script is located.

Specify the Central Admin port number and the authentication mode. Use NTLM for simplicity.

Click Next to start configuring. Again you can go get some drink and come back like 20 mins time

Tada~

If you open your Task Manager, you will noticed that there is one new windows services running “AppFabric Service” which took you 300++mb of RAM. You may actually reduce the RAM usage to make room for other services. Refer here on how to reduce the AppFabric Memory Usage

Once you close the Product Configuration Wizard, IE will be fired up to performance Configuration. Select all services if you like. Also, you may use a separate service account for the services that you intend to add. I would not recommend turning on Search Service Application as this will take up A LOT OF YOUR MEMORY!!!! Please note. Do it only if you have a lot of RAM in your VM Host.

The Configuration may take quite some time. It happened to me before that it stuck forever. In case the screen doesn’t refresh or whatsoever, try to open the Central Admin again. The Services will still be created at the backend.

Create Site Collection

Once the Central Admin is done, you may proceed to create a Site Collection for your primary Web Application – 80

Click on “Create Site Collection” under Application Management tab.

Ensure the Web Application is selected correctly. Put in the Name and select your Site Template

Specify the Primary Site Collection Admin – AHCHENG\spsetup

Click OK!!! and Welcome to SharePoint 2013!

Note: If Newsfeed or MySite is having this “We’re almost ready!” error, please kindly check here to add your server as part of cache cluster

When comes to deployment, my always first rule is to automate the deployment steps.

You could always use site backup and restore for deployment. But that is not my preference, always. Simply because you can’t do this every time when you hit a problem or when you need to reconfigure the whole site.

Well, after some tracing on the Calendar list object class. I found the CalendarSetting property of calendar list.

Unfortunately, there isn’t a fully integrated API for you to configure SP calendar overlay. You have to parse the calendar setting in XML structure yourself. But that really isn’t bad.

At times, you will require to read your data in XML format using Powershell Script. Possible reason to do that is such that you can amend the XML file without editing your original Powershell Script. That’s provided that the standardized Powershell Script can fulfill your requirements.

To cater for More flexibility, you can actually insert Powershell Script within your XML. Here is how you can perform that.

Note that this required a minor change in your Powershell Script. (Not to worry, you only need to edit this once and for all).

$xml = (Get-Content .\yourxml.xml)
$expression = $xml.Scripts.script
#Optionally you can put a foreach loop to run each of your script
Invoke-Expression $expression

Today, My Client has a new requirement to delete certain records from a SharePoint Custom List which contains 80+ k of items. First thing came into my head is to run a powershell script to delete the item based on a certain filter condition. (In my case, it is to delete item with column “Application” equals to “Event”)

Well, with the huge number of list item in the list, one SPListItem took me 40+ second to delete! That’s ridiculous. And what if i have 10k record to be deleted? It would take up 400k seconds (111 hours) to complete!

After few minutes of googling, some suggested to use CAML Query and limit the number of query by using RowLimit = 1000

This doesn’t really help as i really want to delete them ALL at once!

The better way to delete the items is to change the way you query the data especially when comes to retrieving the List item. Here it goes

After checking the SQL, i noticed that the database is not even exist in my database server. I suspect that the previous deleted service application jobs did not clean up properly. To get rid of this 3760 Critical error. Simply Execute the following powershell script.

Note: This script will delete all your non-existing databases. Please do a backup before executing it

Honestly, I personally prefer using Powershell than the old traditional Command Prompts. (no offense to those CMD lovers =X ). It will come to this day where you are asked or required to trace the performance of your SharePoint site. Fortunately, SharePoint 2010 comes with OOTB Developer Dashboard which allows you to track the response times of each of your module within a page.

It is not turned on by default, and here is the tricks to turn it on.

Simply execute the following Powershell Script.

$dds = [Microsoft.SharePoint.Administration.SPWebService]::ContentService.DeveloperDashboardSettings
$dds.DisplayLevel = "On";
#"Off" to turn it off, or "OnDemand" to turn it on demand mode.
$dds.Update()

If you turn it on as “OnDemand” mode, you shall see an icon on the top right hand corner of your SharePoint page if you didn’t modify your master page. [To be specific, the Sharepoint:DeveloperDashboardLauncher web control]

Adding user to SharePoint group manually is a painful process. Not to mention if you have tons of users using your SharePoint site. To make life easier, I actually came out with a simple powershell script and XML (where you store the user mappings) to automate the process.