Virtual Business Card


A Jack of all trades is a master of integration, as such an individual who knows enough from many learned trades and skills to be able to bring their disciplines together in a practical manner, and is not a specialist but can be an expert in many fields. Such a person is known as a polymath or a renaissance man; a typical example is someone like Leonardo da Vinci.

Monday, December 10, 2012

LINQPad

LINQPad is a C#/VB/F# scratchpad that instantly executes any expression, statement block or program with rich output formatting and a wealth of features that "just work".  This tool really works.  To download: http://www.linqpad.net/ 

Wednesday, November 14, 2012

Configure Visual Studio 2012 to Run as Administrator

Windows Server 2012:
  • Go to C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE
  • Right click deven.exe->Properties
  • On the Compatibility Tab click on the Advanced… button
  • Tick on Run this program as an administrator
  • Click on Change Settings for all user and tick on Run this program as an administrator
  Windows 8:
  • Go to C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE
  • Right click deven.exe
  • Select Troubleshoot program
  • Check The program requires additional permissions
  • Click Next, click Test the program...
  • Wait for the program to launch
  • Click Next
  • Select Yes, save these settings for this program
  • Click Close

Tuesday, November 13, 2012

The filtering process has been terminated - SharePoint 2013 Search Content Crawl

This is cause by WSS_WPG group don't have the correct permissions on C:\Program Files\Microsoft Office Servers\15.0\Data\Office Server\Applications  ,  c:\Windows\Temp  . It should have "Full Control"

Make sure that the search index location is in C:\Program Files\Microsoft Office Servers\15.0\Data\Office Server\Applications by Running the following in SharePoint 2013 Management Shell.

Re-install SharePoint 2013.

Cannot import the following key file

The Error: Cannot import the following key file: <filename>.pfx. The key file may be password protected. To correct this, try to import the certificate again or manually install the certificate to the Strong Name CSP with the following key container name: VS_KEY_ E2AEBF22AB52DD08 <Application Name> The Fix:
  1. Open Visual Studio Command Prompt (It can be found in the Windows Start menu)
  1. Type sn -i “c:\Pathtofile\<filename>.pfx” VS_KEY_ E2AEBF22AB52DD08
  1. Reimport the pfx file into Visual Studio
The sn.exe with the –i parameter, installs a key pair from <infile> into a key container named <container>.

Upgrading SharePoint 2010 projects to 2013

  • Open your csproj in notepad.
  • Change the Target Framework Version from v3.5 to v4.5 <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
  • Set the Office Target Version to 15 by entering the following tag to the file below TargetFrameworkVersion tag. <TargetOfficeVersion>15.0</TargetOfficeVersion>
  • Update all referenced assemblies;
    • SharePoint assemblies from version 14.0.0.0 to 15.0.0.0
    • .NET assemblies from 2.0 and 3.5 to 4.0 and 4.5
  • Go to each file (eyeball and replace them one at a time):
  • Replace all 14.0.0.0 in user controls and web parts to 15.0.0.0
  • Replace all version 12.0.0.0 in Pagelayouts to 15.0.0.0. Look specifically at: <%@Register TagPrefix="SharePoint" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" namespace="Microsoft.SharePoint.WebControls"%>
  • Build the project to check for any compilation errors and re-adjust.
  • Update list definitions to take advantage of the new view styles.
  • For all user control and delegate references:Change from: ~/_controltemplates/..To: ~/_controltemplates/15/
  • Change all reference of /_layouts/ to /_layouts/15/
  • Go to the Package.Template.xml and add SharePointProductVersion="15.0" <?xml version="1.0" encoding="utf-8"?> <Solution xmlns="http://schemas.microsoft.com/sharepoint/" SharePointProductVersion="15.0"> </Solution>
  • Make sure that the elements in package.package SharePoint Product Version is set to 15.0

Friday, November 2, 2012

Problem when installing SQL Server 2012 in Windows Server 2012 SqlEngineDBStartConfigAction_install_configrc_Cpu64 /setup.rll

Related Error:

The following error has occurred:
Attempted to perform an unauthorized operation.

Click 'Retry' to retry the failed action, or click 'Cancel' to cancel this action and continue setup

SqlEngineDBStartConfigAction_install_configrc_Cpu64
setup.rll





Solution:

Download Winrar. Do not use winzip or any iso program such as magic ISO to extract the ISO

Extract the ISO to a folder before installation

Run Setup.exe as Administrator,

Install it in drive C:

Thursday, October 18, 2012

CAML Builder / Designer

CAML (Collaborative Application Markup Language) is an XML-based query language that helps you querying and customizing SharePoint sites. The XML elements define various aspects of a SharePoint site.


Download it here

This version of the CAML designer contains the following functionality:

• Log on using the SharePoint server object model, or the SharePoint client object model, or the web services

• CAML snippets for querying a SharePoint list

• Code snippets for the SharePoint server object model, the .NET Client object, the SharePoint web services

 

Tuesday, June 26, 2012

Friday, June 22, 2012

Recursively get all users in a group in Active Directory C#



   1:  using System;
   2:  using System.Collections.Generic;
   3:  using System.ComponentModel;
   4:  using System.Data;
   5:  using System.Drawing;
   6:  using System.Linq;
   7:  using System.Text;
   8:  using System.Windows.Forms;
   9:  using System;
  10:  using System.DirectoryServices;
  11:  using System.Collections.Generic;
  12:  using System.DirectoryServices.AccountManagement;
  13:   
  14:  namespace RecurseUsersInGroups
  15:  {
  16:      public partial class FormGroups : Form
  17:      {
  18:   
  19:          StringBuilder _builder = new StringBuilder();
  20:   
  21:          public FormGroups()
  22:          {
  23:              InitializeComponent();
  24:          }
  25:   
  26:          private void buttonGetAllUsers_Click(object sender, EventArgs e)
  27:          {
  28:              try
  29:              {
  30:                  textBoxUsers.Clear();
  31:                  _builder.Clear();
  32:   
  33:                  PrincipalContext ctx = new PrincipalContext(ContextType.Domain, textBoxDomain.Text);
  34:                  GroupPrincipal grp = GroupPrincipal.FindByIdentity(ctx, IdentityType.Name, textBoxADGroup.Text);
  35:   
  36:                  if (grp != null)
  37:                  {
  38:                      foreach (Principal p in grp.GetMembers(true))
  39:                      {
  40:   
  41:                          if (!_builder.ToString().Contains(p.SamAccountName))
  42:                          {
  43:                              _builder.Append(p.SamAccountName);
  44:                              _builder.Append("; ");
  45:                          }
  46:                      }
  47:   
  48:                      textBoxUsers.Text = _builder.ToString();
  49:   
  50:                      grp.Dispose();
  51:                      ctx.Dispose();
  52:   
  53:                  }
  54:                  else
  55:                  {
  56:                      MessageBox.Show("\nWe did not find that group in that domain, perhaps the group resides in a different domain?");
  57:                  }
  58:              }
  59:              catch (System.Exception)
  60:              {
  61:   
  62:                  MessageBox.Show("\nWe did not find that group in that domain, perhaps the group resides in a different domain?");
  63:              }
  64:             
  65:   
  66:   
  67:          }
  68:   
  69:   
  70:   
  71:      }
  72:  }

Thursday, June 21, 2012

Anonymous Access, SharePoint not ‘Forcing’ an Automatic Sign In

If for what ever reason (read disclaimer at end) you need anonymous access enabled on a SharePoint site that is using windows authentication, you will notice that even as an authorized user you are not signed in automatically. The anonymous ‘experience’ will always take precedence over the users credentials.


This is the way the HTTP protocol works so IIS and SharePoint are off the hook for this issue.


If you do want to be a recognized user then you will need to click on the ‘Sign In’ link at the top of the site. Depending on your browser security settings you will either be signed in automatically or prompted for credentials.
Solution:

This is less of a solution and more of a work around but it will achieve the desired result. To force an auto-sign in under SharePoint you need a page that has unique permissionsto force the challenge/response for credentials. This can then be provided to the authenticated users as the ‘authenticated’ homepage url.


There are a few limitations with this method:
  • Anonymous users will not be able to access this page
  • To be more useful the page will probably need some redirection, i.e. To pass the user back to a global home page, and this provides its own set of challenges
  • Unless the authenticated user hit this page first, i.e. They follow direct links to somewhere else in the site, they will not be signed in

Friday, June 8, 2012

Error When Creating an Appointment in Nintex Workflow 2010

When you run the workflow, you get the error:




Failed to invoke web service. Error returned from server: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel



To solve the problem:

1.) Add the root certificate of the web service. For more details look at:

http://connect.nintex.com/forums/thread/1433.aspx

2.) Run



foreach ($cert in (Get-ChildItem cert:\LocalMachine\Root)) { if (!$cert.HasPrivateKey) {New-SPTrustedRootAuthority -Name $cert.Thumbprint -Certificate $cert } }



For more details: http://connect.nintex.com/forums/post/19080.aspx



Tuesday, June 5, 2012

Detail Tool Tip for Room Manager Calendar for SharePoint 2010

My developer and I have been working on a custom tool tip for a calendar for Room Manager which is a third party Room Booking Solution for SharePoint 2010.  What the tooltip does, is it does an ajax call to the details page of the room booking and display it in a tool tip.  We used the sample javascript found in http://sharepointjavascript.wordpress.com/2012/02/12/list-view-preview-item-on-hover-sharepoint-2010/ and tweeked it a bit.  The solution is two part: PreviewItemOnHovertest.js and a content web part on the calendar page.


PreviewItemOnHovertest.js:
https://skydrive.live.com/redir?resid=9F717AF2A2401F0F!5088

 
If you want to customize what fields participates in the hover (e.g. using Sharepoint Calendar WebPart), modify the calAddHover function.

Content Web Part:
https://skydrive.live.com/redir?resid=9F717AF2A2401F0F!5089

Tuesday, May 29, 2012

Business Process Management Notation Cheat Sheet Poster

The latest version of the popular modeling language for business processes is in the final stages. There are new modeling constructs and two additional diagram types available in 2.0.



The new BPMN 2.0 Poster gives you a handy overview over the new constructs. It was created by the "Berliner BPM-Offensive" and is available for download for free.

http://www.bpmb.de/index.php/BPMNPoster

Tuesday, May 8, 2012

Scoped Site not being indexed or crawled in SharePoint 2010

To resolve this:


Site Settings->Search and Offline Availability

Under Indexing Site Content select “Yes”


Related Error:

This item and all items under it will not be crawled because the owner has set the NoCrawl flag to prevent it from being searchable .



Thursday, May 3, 2012

Increase WebService call TimeOuts in Nintex Workflow 2010

If the web service call times out you may be able to correct this by increasing the timeout value using the SetCallWebServiceTimeout NWAdmin operation. This operation is used to specify how long every call web service action should wait before causing an error due to a timeout. Note that having many workflows that remain processing in memory for a long time (for example, while waiting for a web service response) is not recommended.

Usage

NWAdmin.exe –o SetCallWebServiceTimeout –milliseconds numberOfMilliSeconds

Parameters

Name    Description

- milliseconds     The number of milliseconds the call web service action should wait before timing out. The default is 100,000 milliseconds (100 seconds).

Full details of the using NWAdmin can be found on Connect: http://connect.nintex.com/files/folders/technical_and_white_papers_nw2010/entry12004.aspx


Display Unique Permissions in a SharePoint 2010 Site

http:///_layouts/uniqperm.aspx


Error 404 when browsing SharePoint 2010

To troubleshoot further:

If a page element is missing—either a user control hasn’t been deployed or something else that needs to be in place for the page to compile dynamically is awol—you might be the proud owner of a 404 even though the page itself does exist.

HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.

After setting the SafeMode element’s CallStack element true in web.config, turning off CustomErrors, and setting the debug=”true” attribute on the compilation element, you’re possibly looking at a beautiful ASP.NET error message with no stack trace and not a lot to go on


NT AUTHORITY\authenticated users cannot be granted Permissions in SharePoint 2010

When you want to add all authenticated users, you need to add 'NT AUTHORITY\authenticated users'.


But if you type it in and click Check Names, this will give you a strange name.

Solution:

You need to just type it in and press OK.

Session state can only be used when enableSessionState is set to true SharePoint 2010

Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. Please also make sure that System.Web.SessionStateModule or a custom session state module is included in the \\ section in the application configuration.

1. On all servers open the web.config of the web application then set enableSessionState to true and start the aspnet state service




Also comment out the following line



securitytoken.svc/actas is too busy SharePoint 2010

An exception occurred when trying to issue security token: The HTTP service located at http://localhost:32843/SecurityTokenServiceApplication/securitytoken.svc/actas is too busy. .


An unexpected error occurred. Error 52068.

Exception details:

System.ServiceModel.ServerTooBusyException: The HTTP service located at http://localhost:32843/SecurityTokenServiceApplication/securitytoken.svc/actas is too busy. —> System.Net.WebException: The remote server returned an error: (503) Server Unavailable.

at System.Net.HttpWebRequest.GetResponse()

at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)


Resolution was re-provision the Security Token Service application.

PS C:\Users\sowmyans> Get-SPServiceApplication


DisplayName TypeName Id



———– ——– –



Access Services Access Services W… 77562ca9-5c80-45f4-9a21-6d86c013eb75



Secure Store Service Secure Store Serv… 5eceb8dd-ef3d-4c7d-b900-59436e4743a1



State Service State Service 54dfbd6d-dc83-48e9-9b79-a52853aad23d



PerformancePoint … PerformancePoint … 7556e63a-4c50-400c-8788-de6724b64ab7



Visio Graphics Se… Visio Graphics Se… ac3ab2e0-3952-473d-9901-001b050ef945



Managed Metadata … Managed Metadata … 32eeb3d8-b710-4635-81d5-771701072593



Web Analytics Ser… Web Analytics Ser… 9cb8fdbb-c87c-4c11-9c91-d89e04aec703



Excel Services Ap… Excel Services Ap… 8918fc32-b6f2-49ad-9d60-f0d7a866d85d



Security Token Se… Security Token Se… 033b6266-261d-4318-9a9a-36f0e390d346



Application Disco… Application Disco… 80a9e9de-88d0-4ce1-8108-380117fc1c11



Usage and Health … Usage and Health … 746c7339-1e8c-47ae-8583-ea80faae5fac



Search Administra… Search Administra… 944cfcd9-155e-41c0-82b7-95386d737fcb



Word Automation S… Word Automation S… c2a414b6-dfb7-4974-8eb4-6c2c6da65af0



Application Regis… Application Regis… e1131c58-0242-4aab-9156-1de22c2be8a4



User Profile Serv… User Profile Serv… 24f623c3-d368-4901-aee0-aed2f8e3f129



Business Data Con… Business Data Con… 2d21dffe-a188-42d7-b46e-04850805bcde



Lotus Notes Conne… Lotus Notes Conne… 115431c5-80e7-40d4-bdd8-7a7254951714



Search Service Ap… Search Service Ap… 1f69450e-c835-4219-9b46-7f444c204059



PS C:\Users\macevi> $sts = Get-SPServiceApplication | ?{$_ -match “Security”}

PS C:\Users\macevi> $sts

DisplayName TypeName Id

———– ——– –

Security Token Se… Security Token Se… 033b6266-261d-4318-9a9a-36f0e390d346


PS C:\Users\macevi> $sts.Status
Online

PS C:\Users\macevi> $sts.Provision()

Solution stuck at deploying or retracting in SharePoint 2010

The first steps in resolving this would be to ensure that the SharePoint Administration service is running correctly and potentially try to restart it as described in the forum post. Since the solution was successfully deployed the latest version is actually already applied in your environment only the live framework has not been installed.




Since leaving it for a while eventually allowed the solution to deploy we recommend reviewing the deployment again after some time. Apart from this you can try reviewing the SharePoint logs for any SharePoint errors that may suggest why the deployment became stuck. Please note that any solution you try to deploy at this point will become stuck, this will not only affect our latest version. The way we deploy the solution has not changed between versions and the deployment is controlled entirely by SharePoint.



For issues with the solution package being stuck in deployment.

Can you please try following these instructions. Basically, this will cancel the deployment that is stuck in progress allowing you to start again. Unfortunately, this issue is occasionally seen with SharePoint Solution Packages.

First run this command which will show you all in-progress deployments, there will probably be only the one.

stsadm -o enumdeployments

Look for the JobId string corresponding to the Nintex workflow deployment job

and then run:

stsadm -o canceldeployment -id “you job id string here”

This should cancel the deployment, and if you go to the solution management pages in Central Administration the solution should be listed as ‘not deployed’.

From this point you can try again. We have found that it usually just works the second time; if not the SharePoint logs will need to be analysed to try and determine what is causing the failure.

This stsadm command will do a deployment, the same as pressing the deploy button within the Central Administration UI.

stsadm.exe -o deploysolution -n nintexworkflow2007.wsp -allcontenturls -immediate -allowgacdeployment

Hopefully when you run this command (again, all these commands can be run on the one front end server) it will install correctly.

If the solution package is listed as Error.

Can you please ensure the Windows SharePoint Administrative service is running. To do this please open the services management console (start->run then services.msc) and ensure the service is listed as Started.

Once this has been done you will have to execute the stsadm command:


stsadm.exe –o execadmsvcjobs


Please also check the solution information page by clicking on the solution package link in Central Administration -> Operations. There may also be additional information about the cause of your error.



Testing other simple solution packages in your environment.


There are two simple solutions that will help determine the scope of any issues you are experiencing with solution deployment. They can be used to confirm the issue is global to the environment.


The commands to add the solutions to the solution store is:


stsadm.exe -o addsolution -filename


You can use the Central Administration UI to actually deploy them.


WSP 1:

http://download.nintex.com/sl/supportfiles/TestingSolutionGlobal.zip


This solution deploys globally, it does not require a url to be specified.


It will create a file at C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE called TestingSolutionGlobal.txt


If Solution 1 does deploy correctly, then please also try WSP 2 as well, which is slightly more advanced.


WSP 2:

http://download.nintex.com/sl/supportfiles/TestingSolutionForWebApps.zip

This solution does require a web application to be selected.


It will create a file at C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE called TestingSolutionForWebApps.txt, deploy a file called SimpleSolution.dll to the GAC and add an entry to the web.config file for the web application as follows:



Note that the SimpleSolution.dll contains no code that will execute.

Using the 2 solution packages listed above can help determine if the issue is with the nintexsolutionpackage or all solution packages in general. If these solutions also do not deploy we suggest you contact microsoft for addictional support as this indicates an issue with your SharePoint envrionment, which we are not able to troubleshoot.


Possible causes of your deployement issue / log files to investigate.

Please check your SharePoint logs for the time the solution was schedule to be deployed. The logs are found by default at c:\program files\common files\microsoft shared\web server extensions\12\Logs.

A sample error from a log where we have previously seen this issue:

“The Execute method of job definition Microsoft.Office.Server.Search.Administration.IndexingScheduleJobDefinition (ID xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx) threw an exception. More information is included below. An update conflict has occurred, and you must re-try this action. The object IndexingScheduleJobDefinition Name=Indexing Schedule Manager on servername Parent=SearchService Name=OSearch is being updated by DOMAIN\username, in the OWSTIMER process, on machine SERVERNAME. View the tracing log for more information about the conflict.”


these errors suggest a critical timer job error relating to internal SharePoint problems persisting object to the database. These errors also mention ‘update conflict’ as experienced when attempting solution deployment. We believe this underlying issue could be preventing solution deployment and must be resolved.


When seeing errors of these kind you should be able to contact Microsoft directly for additional support as we are not equipped to resolve sharepoint deployement issues.



Cannot retract a solution. Solution stuck at retracting


Other symptoms: Cannot uninstall the LanguagePack 0 because it is not deployed

work around would be to cancel retraction and execute the following command:

stsadm.exe -o deletesolution -name testingsolutionforwebapps.wsp -override



Additional Things to Check:



Have you installed SP1 with/without June 2011 CU? Maybe that’s the problem. Try installing December 2011 CU.

"Access denied" to Site Collection administrator / Site Actions not showing

One morning I kept getting "Access denied".


• I got access denied when I accessed that root of the site. http://site/

• I got access denied when I accessed the settings page http://site/_layouts/settings.aspx

• I got access denied when I tried to modify any file in SharePoint designer.

I was defiantly a site collection administrator.

Then the sun started to shine. It turns out that the site collection had been locked when I checked in "Site collection Quotas and Locks". Now why didn't I think of this sooner. I should have known better.

How Enable Audit Log Reports Option in SharePoint 2010

STSADM.EXE -o activatefeature -name Reporting -url http://sitecollectionurl/ -force

How to Trim Audit Log in SharePoint 2010

Please use the power shell below:



$site = Get-SPSite -Identity http://

$date = Get-Date

$date = $date.AddMilliseconds(1)

$site.Audit.TrimAuditLog($date)

or

$site.Audit.DeleteEntries($date)