The username is invalid. The account must be a valid domain account – SharePoint 2013 Setup Error

When configuring SharePoint 2013 Development Virtual server in “Complete” mode you get below issue.



“The username is invalid. The account mist be a valid domain account” when using a local account to configure the farm”

NOTE: Out of the box SharePoint only supports “Stand-alone” mode for non domain environments, but this forces you to use SQL Server 2008 R2 Express Edition which is most cases is unacceptable.

Use a PowerShell command to create the initial configuration of the farm with a local account:

  1. Start the SharePoint Management PowerShell
  2. Run “New-SPConfigurationDatabase” from the command line and follow the instructions
    Database Name: Sharepoint_Config
    DatabaseServer: Name of your SQL Server
    Farm Credentials : localservername\username
    Passphrase : Must contain at 8 character with one Caps,one number,& special character
  3. This will create the farm and configure the necessary accounts.
  4. Rerun the configuration wizard
  5. After it finishes start the Config Wizard and configure your server with all components
  6. Select “Do not disconnect from this server farm


  7. Done!




Leave a comment

Posted by on September 20, 2014 in SharePoint 2013


Tags: ,

Windows Server App Fabric is not correctly configured – SharePoint 2013 Setup Errors

When installing SharePoint 2013 SP1 prerequisites on Windows Server 2008 R2, the prerequisite installer fails with the following error



“Windows Server App Fabric is not correctly configured. You should uninstall Windows Server Appfabric and reinstall it using the Sharepoint Products Preparation Tool.”

This occurs when u try to run “PREREQUISITEINSTALLER.exe” as standalone installation.

The resolution is to run “prerequisiteinstaller.exe” with command line parameters to directly specify the file name for each prerequisite.

  1. Uninstall exisiting installation of AppFabric
  2. Delete “PSModulePath” from system environment variables entry.
  3. Restart server
  4. Open command prompt
  5. Navigate to SharePoint 2013 setup files folder (eg: D:\)
  6. Type following line
    prerequisiteInstaller.exe /appfabric:Z:\Softwares\Sharepoint 2013PreRequisite\WindowsServerAppFabricSetup_x64.exe
    (NOTE:  Z: is my Prerequisite files folder location. replace with you path)
  7. image_thumb_6
  8. Done! Continue installation…

Posted by on September 20, 2014 in Bug, SharePoint 2013, Tips & Tricks


Tags: ,

Useful URL Shortcuts in SharePoint

Page Name URL
1. Sign in as a different user /_layouts/closeConnection.aspx?loginasanotheruser=true
2. Open Page in Edit Mode ?ToolPaneView=2
3. Web Part Maintenance Page ?Contents=1
4. Site settings page /_layouts/settings.aspx
5. View all site content page /_layouts/viewlsts.aspx
6. Get the version of the SharePoint server /_vti_pvt/Service.cnf
7. Sandboxed Solution Gallery: /_catalogs/solutions/Forms/AllItems.aspx
8. Workflow history hidden list: /lists/Workflow History
9. Filter toolbar for Lists and libraries ?Filter=1
10. Site usage page /_layouts/usage.aspx
11. Site content and structure  page /_layouts/sitemanger.aspx
12. Manage site collection features
13. Manage site features /_layouts/ManageFeatures.aspx
14. Show Page in Dialog View ?isdlg=1
15. Application page for registering SharePoint apps /_layouts/15/appregnew.aspx
16. Save Site as a template /_layouts/savetmpl.aspx
17. Enable SharePoint designer /_layouts/SharePointDesignerSettings.aspx
18. Set Welcome Page /_layouts/AreaWelcomePage.aspx
19. Change Site Master Page /_layouts/ChangeSiteMasterPage.aspx
20. Page Layouts and Site Templates /_Layouts/AreaTemplateSettings.aspx
21. Master Pages library /_catalogs/masterpage/Forms/AllItems.aspx
22. User Information List _catalogs/users/simple.aspx
23. Quick Deploy List Quick%20Deploy%20Items/AllItems.aspx
24. Taxonomy Hidden List (MMS) Lists/TaxonomyHiddenList/AllItems.aspx
25. Force displaying the user profile in the site


Leave a comment

Posted by on July 31, 2014 in Tips & Tricks


Tags: ,

Sharepoint “Workflow Auto Cleanup” mystery

Does anyone know that SharePoint workflow history is getting deleted after 60days. By default there is a timer job called “Workflow Auto Cleanup” associated with your web application which will delete all your workflow task history after 60 days  if the status is  Completed or Cancelled.

Now the question is, Does it really deletes whole workflow history?

No, Technically, the workflow history is not deleted. The association between the workflow (what you see on the workflow status page) and the history list is removed. This is done for performance reasons. Once a workflow is completed, by default the connection between the workflow and the workflow history is deleted after 60 days.

Is it Possible to disable this timer job?

Yes, You can disable the “Workflow Auto Cleanup” timer job if you wish to keep the workflow data. however, this is not really recommended due to the potential impact to performance of allowing these lists to grow indefinitely.

To disable automatic workflow cleanup follow below steps

  • From Central Administration, click the Monitoring tab 
  • On the Monitoring page, click Review job definitions.
  • On the Timer Job Definitions page, click Workflow Auto Cleanup to edit the appropriate timer job.
  • On the Edit Timer Job page, click Disable and then click OK to disable the Workflow Auto Cleanup feature.

NOTE: If you later decide that you want to enable automatic workflow cleanup, access this page again and click Enable to enable automatic workflow cleanup.

What is the alternate solution to audit my workflows?

Unfortunately, this auditing report is not available out of the box. However, a custom audit report can be created in Visual Studio in order to extend the auditing functionality to include workflows.Read here


Tags: , ,

Resolved: Could not load file or assembly ‘Microsoft.SharePoint.Sandbox, Version=, Culture=neutral, PublicKeyToken=XXXXXXXXX’ or one of its dependencies…

I have a remote sharepoint solution that contains SharePoint dll’s reference. Whenever I run the solution, start page get crash and show me this error.

“Could not load file or assembly ‘Microsoft.SharePoint.Sandbox, Version=, Culture=neutral, PublicKeyToken=XXXXXXXX’ or one of its dependencies. An attempt was made to load a program with an incorrect format.”

Well every time I run the project it creates Microsoft.SharePoint.Sandbox.dll and Microsoft.SharePoint.Sandbox.xml inside the bin folder and it creates the problem. Well there are lots many things have written on web regarding this problem. I follow all these things but could not get rid of this error. Finally I decided to fix this problem according to my way. So below are the steps to fix this problem permanently.

1. Inside solution explorer (Visual Studio), select the project and right click on that.

2. From context menu, click on properties.

3. When properties page opens, Click on Build Events.

4. Under Post – build event command line, copy and paste below lines

cd $(TargetDir)

del Microsoft.SharePoint.Sandbox.dll

del Microsoft.SharePoint.Sandbox.xml


NOTE: please replace with your dll name.


Programatically select and bind Sharepoint list items to ASP.NET controls

  • Open Visual Studio 2010
  • Create New Project
  • Select your Sharepoint site
  • Create Visual Webpart
  • Add LAbels,Textboxes or Dropdownlist (NOTE: Update control names in your code accordingly)
  • Use below code in page load event


SPQuery query = new SPQuery();
query.Query = “”;
query.ViewFields = “”;
query.RowLimit = 100;

using (SPSite site = new SPSite(SPContext.Current.Web.Url))

using (SPWeb web = site.OpenWeb())

SPList list = web.Lists.TryGetList(“—ADD LIST NAME—“);

//Check List Exists

if (list != null)


//Check ITEMS Exists

if (list.GetItems(query).GetDataTable() != null)
DataTableReader rdr = list.GetItems(query).GetDataTable().CreateDataReader();

if (rdr.Read())

//Bind list items to ASP.NET Label

Label1.Text = rdr[“Test_x0020_Item1”].ToString();
Label2.Text = rdr[“TestField2”].ToString();

//To bind DROPDOWNLIST uncomment below code
// dropdownlist1.DataSource = rdr;
// dropdownlist1.DataTextField = “Title”;
// dropdownlist1.DataValueField = “Title”;
// dropdownlist1.DataBind();

//To bind REPEATER uncomment below code
// Repeater1.DataSource = rdr;
// Repeater1.DataBind();


lblInfo.Text = “No Items Found”;
lblErrorMessage.Text = “List not found.Please make sure list is created and go to webpart settings to add the List name “;


catch (Exception ex)
lblErrorMessage.Text = ex.Message.ToString();


Tags: ,

Programatically Insert Items to Sharepoint 2010 List using

  • Open Visual Studio 2010
  • Create New Project
  • Select Your Sharepoint site
  • Create New Visual Webpart
  • Add Textbox,Label and Button as required(NOTE: Controls names You need to update in below code)
  • Add below code in button click event the code


using (SPSite site = new SPSite(SPContext.Current.Web.Url))
using (SPWeb web = site.OpenWeb())

SPList List = web.Lists.TryGetList(“—ADD LIST NAME—“);
if (List != null)

SPListItem NewItem = List.Items.Add();

web.AllowUnsafeUpdates = true;

NewItem[“Title”] = Label1.Text;
NewItem[“Employee Name”] = Label2.Text;
NewItem[“Comments”] = Textbox1.Text;


//int newID = NewItem.ID;

web.AllowUnsafeUpdates = false;

lblInfo.Text = “Item Inserted Successfully.”;



lblErrorMessage.Text = “List not found. Configure the list from webpart settings”;


catch (Exception ex)
lblErrorMessage.Text = ex.Message.ToString();


Posted by on November 14, 2012 in Code Snippets, Uncategorized, Visual web part


Tags: , ,