Automatically load SharePoint PowerShell Snapin while launching PowerShell ISE

This is something that you only need to do once on every SharePoint environment where you will be using PowerShell ISE.

Execute following script:

## This script will append your powershell ise profile file with code stored in $cmd variable which will be executed everytime you launch PowerShell ISE
if (!(test-path $profile ))
{
new-item -type file -path $profile -force
}

$cmd = ‘if((Get-PSSnapin | Where-Object {$_.Name -eq “Microsoft.SharePoint.PowerShell”}) -eq $null)
{
Add-PSSnapIn “Microsoft.SharePoint.Powershell”
}’

out-file -FilePath $profile -InputObject $cmd -Append

Sandboxed Code Host Service was too busy to handle the request

I had really hard time fixing deployment issues for Sandboxed solutions when I had a Feature Event Receiver class added in my solution for a very simple, basic feature.

Firstly, I found that deploying from Visual Studio only gave me unfriendly error message: “The Sandboxed code execution request failed” at the time of feature activation. After some searching, it suggested that my dev environment may have permissions issue for the service account under which my Sandbox Code Host Service was running. I tried to fix, but couldn’t get it working.

I rebuild my dev VM and then I again configured my Farm. When I reached to the point where I can deploy my Sandboxed Solution again, it gave me this error message:

The sandboxed code execution request was refused because the Sandboxed Code Host Service was too busy to handle the request

I came across this article written by Chris Zhong Error: “The sandboxed code execution request was refused because the Sandboxed Code Host Service was too busy to handle the request”

Following the suggested steps in that article, it fixed my problem.

Ujjaval

Table valued functions can not be granted ‘EXECUTE’ permission

I found an error when I was trying to deploy my database project:

Granted or revoked privilege EXECUTE is not compatible with object on

After quick search on google, I learned that table valued functions can not be granted ‘EXECUTE’ permissions. Instead they need to be granted ‘SELECT’ permissions.

It makes sense and never realised this until I hit this problem. I have been using Table valued and Scaler valued functions and didn’t notice that you use select on table valued functions and execute on scaler valued functions.

260 characters limitation for TFS Build Path

I created new build definition and had following error message when I tried to build.

error MSB4023: Cannot evaluate the item metadata “%(FullPath)”. The item metadata “%(FullPath)” cannot be applied to the path “”

Looking at it closely found that TFS Build has limitation of handling path length of up to 260 characters.

Presently I renamed my build definition such that it brings physical path to just under 260 characters.
Ideally source code file names will not be so long that it will make full path longer than 260 characters. However, it may not be possible at a particular point in time of project.

Enable Report Builder Access on Report Server using Basic Authentication

We have a SQL Server 2008 R2 Report Server running under Basic Authentication mode. This is recently upgrade report server.

When a user tried to access Report Builder, user gets

401 – Unauthorised

error message.

As per Microsoft documentation Configure Basic Authentication on the Report Server, it suggests that Basic Authentication is not supported for ClickOnce application installer, which is used by Report Builder application.

To work around this issue, article suggests to configure Anonymous Access to the Report Builder program files.

This is done by adding following tag in RSReportServer.config under block.

True

Save the config file and restart report server.

This should resolve and allow report builder to be accessed by user.

NuGet and TFS set up: 401 Unauthorised error

Install NuGet package manager today and attempted to install jQuery through it.

Ran into problem with TFS giving error for Unauthorised Access.

I searched through and found a great article through various forum which explained the problem and suggested a very simple solution.

Fixing combination of NuGet and Team Foundation in workgroup configuration: 401 Unauthorized

Solution in summary:

– I needed to close Visual Studio.
– Add http:// in to my Internet Explorer’s [Local Intranet] Sites list in Internet Options.

Report Builder caching user credentials on local computer

We faced a problem where testers needed to test few report models based on various security roles for different users.

They used to log on as AdminUser, test relevant report models and then log off.

Using the same computer, after clearing cache of browser and clear recent items from Report Builder settings, they log on as another NormalUser to test other relevant report models. NormalUser has less privileges compare to AdminUser.

They face problem where they can still have access to report models that AdminUsers had access to while they log on as NormalUser in Report Builder.

One of my colleague found out that Report Builder actually stores some credentials information in a config file on local computer.  This config file can be found at 

C:\Users\<user name>\AppData\Local\Microsoft\Report Builder\10.50.0.0

Users need to delete that config file if they need to log on as another user on same report server via Report Builder. 

 

Hyper-V VM Import issue with joining Domain

I have kept running into this situation:

I have an Exported VM from Hyper-V with Windows Server 2008 R2 installed as a stand alone box not joined to any domain with the view to reuse this to stand up different VMs.

I copy this Exported VM folder to create another VM. I import VM from the copy I just created. I selected the option as shown in screenshot below.

After import is complete, I start VM and joined Domain. I restart VM.

When VM comes back up from restart, I log on using my Domain credentials which I used to join domain. My domain credentials are part of Domain Admins group.

VM thinks it has joined domain, but it does not have Domain Admin group under local [Administrators] group. Thus I didn’t have permissions to perform any admin operations on VM.

I have faced with similar problem before.

General Fix:
Previously I seem to remember that by leaving the domain, Deleting this VM from Domain Controller and joining Domain again will fix this problem.
But this time it didn’t fix it.

So, I searched around again and found this article:

http://social.technet.microsoft.com/Forums/en-US/winserverDS/thread/dcff7b65-f813-4b91-8f88-6f8d19b9f924/

Article was suggesting to do the same thing as I have outlined in General Fix above.
But it also had someone idea of using SysPrep utility to reSID VM. This is NOT AT ALL RECOMMENDED for doing this on any Production VM image.

However After running SysPrep utility using Generalize option, it fixed my problem when I joined Domain after running this utility.

My thoughts and learning outcomes about Technology, Software Development etc.