Navigation

Sunday 23 November 2014

Constraint violation occurred active directory C# Directory Services

While creating user accounts in active directory using Directory Services through C# we commonly encounter error  Constraint violation occurred.
This is an error which gives the generalized error message where developers can not find the reason of exception or error details exactly. Same way i have wasted 2 hours of time on this error to find out the exact reason and common scenarios related to it. This is because of following cases,

1. When we try to update the country attribute  'c' with string: - Country attribute should be set with only 3 characters or less, if we try to update 'c' attribute with string more than 3 characters length we face Constraint violation occurred error.

In the same way if we try to update any attribute with data that violates it's constraints we may face this generalized error so please make sure you are updating attributes with correct information.

For all attributes information please follow my previous post 

Note: Exception is thrown only at de.CommitChanges(); (de is instance of DirectoryEntry type) irrespective of all lines of code where we set attributes before this line

Sunday 16 November 2014

Why Microsoft and Why enterprises use office 365 over google apps

Most of us think that, is there any replacement for Microsoft Office but, Microsoft has its own market with its improved office 365. Please check below link for more information
http://www.whymicrosoft.com/see-why/enterprises-choose-office-365/

Tuesday 11 November 2014

User Attributes in Active Directory

Click this link to download PDF which has all attributes information of Active Directory user objects.

For more information please follow this link


Thursday 30 October 2014

Installing Windows Service with Command Prompt and Visual Studio Command Prompt

We can install windows service into Services on windows server with the help of InstallUtil.exe a
command line utility using 

1. Using Visual Studio Command Prompt 
2. Command Prompt

InstallUtil.exe is the command line utility which is installed with .Net frame work and its path is %WINDIR%\Microsoft.NET\Framework[64]\<framework_version>

I. Using Visual Studio Command Prompt 
  1. On the Windows Start menu or Start screen, choose Visual Studio Visual Studio ToolsDeveloper Command Prompt.
    A Visual Studio command prompt appears.
  2. Access the directory where your project's compiled executable file is located.
  3. Run InstallUtil.exe from the command prompt with your project's executable as a parameter:
           installutil <yourproject>.exe



Sunday 25 May 2014

Filtering ULS Log using Power Shell

It is very handy using Get - SPLogEvent power shell command to retrieve logs from ULS in certain time period .

Use bellow command syntax 

get-splogevent -starttime (get-date).addminutes(-20) | where-object { $_.correlation -eq “b66db71a-3257-4470-adf9-5c01dc59ecb3″ } | fl message > c:\errors.txt

For more information please follow link

Managing SharePoint Configuration

Saturday 8 February 2014

View All Site collections in the Farm


  1. Verify that the user account that is performing this procedure is member of farm administrations SPGroup.
  2. On the central Administration Home Page, click on  Application Management
  3. On the Application Management page, in the site collections page, click view all site collections
  4. Select the web application in Web Application drop down for which you want to see the site collections
For More information follow link