Archive for October, 2013

Every two months, Microsoft releases Cumulative Updates for SharePoint 2010 and 2013. The October Cumulative Updates for both SharePoint 2010 and SharePoint 2013 have been released and here are the download links and KB articles for both products in one easy location!

SharePoint 2013 October Cumulative Update

October Cumulative Updates

The October 2013 Cumulative Update brings SharePoint 2013 to Build Number 15.0.4551.1001

KB

SharePoint Foundation 2013- KB 2825674

SharePoint Server 2013 – KB 2825647

Project Server – KB 2825650

Office Web Apps – KB 2825686

Downloads

SharePoint Foundation 2013

SharePoint Server 2013

Project Server

Office Web Apps

SharePoint 2010 October Cumulative Update

The October 2013 Cumulative Update brings SharePoint 2010 to Build Number 14.0.7110.5000

KB

SharePoint Foundation 2010- KB 2825824

SharePoint Server 2010 – KB 2825786

SharePoint Server 2010 with Project Server – KB 2825793

Downloads

SharePoint Foundation 2010

SharePoint Server 2010

SharePoint Server 2010 with Project Server

Did you install this cumulative Update? Did it introduce any new bugs or having any problems… make sure you write it in the comments!

Share this post with your followers on twitter:

Leave  a comment and don’t forget to like us on Facebook here and to follow me on Google+ here and on Twitter here  for the latest news and technical articles on SharePoint.  Also, don’t forget to check out SharePoint Community.Net for more great SharePoint Content

No ratings yet.

Please rate this

Introduction

Creating a SharePoint Development Virtual Machine is something you might have to do quite a few times as a Developer. Even if it’s a pretty easy process, on a slow machine it can easily kill 4-5 hours of your day only to install SQL, SharePoint, Visual Studio and all the others tools you might need to get started. What if you could just script it so it’s all done automatically while you go take coffee, chat on SharePoint Community or whatever else you enjoy doing? In this tutorial we will learn how to build a script that we will keep using for as long as you keep developing on SharePoint 2013. The tutorial will be split in a few sections since in order to keep them focused and short, and at the end they will all be published in a downloadable PDF. I strongly encourage you to not only copy the scripts, but actually read the blog posts of why I did them like this and there are some parts where you will need to work as well!

Sections:

  1. Introduction & Prerequisites & Creating the Domain and Service Accounts
  2. Installing software prerequisites + SQL
  3. Installing SharePoint 2013
  4. Installing Visual Studio 2012 and Optional Software
  5. Basic Optimizing and Summary
  6. Advanced Optimizing of the scripts! (You are here)
  7. An eBook Guide of the 6 sections and a video! (19/11/2013)

The Optional Software we will install!

  • Microsoft SharePoint Designer 2013
  • Google Chrome
  • Firefox
  • NotePad++
  • Smtp4dev
  • ULSViewer
  • SharePoint Host named Site Collection (HNSC) Creator

Visual Studio 2012 Installation

It’s no secret that the only tool we really need for SharePoint Development is Visual Studio! In this part of the tutorial we will Install Visual Studio 2012, as well as the Office Developer Tools needed to develop on SharePoint 2013. First of all, we will copy all the Visual Studio Installation Bits from the ISO to a new folder in C:\SharePoint\Software\VisualStudio2012. We will put all the binaries from this chapter in C:\SharePoint\Software\ProgramName. This will make our structure a lot cleaner! It will look something like this:

Next, what we need to do is open the “AdminDeployment.xml” with a notepad editor and change <BundleCustomizations TargetDir=”default” NoWeb=”default”/> to <BundleCustomizations TargetDir=”default” NoWeb=”yes”/>


PS: First time it failed the installation because I entered “Yes” instead of “yes”. So make sure you enter everything in lowercase.

Then, open powershell and run the following command: (If you have Visual Studio Premium, the .exe name might change, so make sure you also change it in script!)

New-Item -ItemType directory -Path C:\AutoInstallLogs
cd C:\SharePoint\Software\VisualStudio2012
.\vs_ultimate.exe /full /noweb /quiet /ProductKey YKCW6BPFPFBT8C97DCTHQXGWC /Log C:\AutoInstallLogs\VS2012.txt

This Operation will take a while however, we will know when it’s done when it stops modifying files in the C:\AutoInstallLogs folder! I know it’s not the best way out here, however in part 6 we will see how to make it better!

Install the Office Developer Tools for Visual Studio 2012

This Process is divided in two steps: The first step is to actually download all the files, and the second step is to install them on a virtual machine! For the first step, you will obviously need an internet connection, however you can do it on any machine!

Downloading the Office Developer Tools Package

The first thing you need to do is go to the MSDN Website here: http://msdn.microsoft.com/en-us/office/apps/fp123627.aspx and download the Microsoft Office Developer Tools for Visual Studio 2012 package.

Once it’s downloaded, open it with the GUI at least once, so it installs the latest version of the Web PlatForm Installer (4.6 at the time of this writing). As soon as the WPI window opens, close it! Afterwards, run this PowerShell command!

WebpiCmd.exe /offline /products:OfficeToolsForVS2012RTW /Path:C:\SharePoint\Software\OfficeToolsForVS2012RTW

It will download a bunch of files and will put them into folders pretty cleanly! Also, by default, the WebPlatForm Installer commands are not installed, and if you don’t have an internet connection, you might get a nasty error! So what we will do is download the WebPi binaries from here: http://www.iis.net/learn/install/web-platform-installer/web-platform-installer-v4-command-line-webpicmdexe-rtw-release  (Direct Download: http://download.microsoft.com/download/7/0/4/704CEB4C-9F42-4962-A2B0-5C84B0682C7A/WebPlatformInstaller_amd64_en-US.msi  )

Installing Microsoft Office Developer Tools for Visual Studio 2012

Now, Run the following Command in order to install it! The first 2 lines are only for “Future” Virtual Machines to make sure they install the newest Web Platform Installer and you don’t need to run them on this one!

C:\SharePoint\Software\OfficeToolsForVS2012RTW\WebPlatformInstaller_amd64_en-US.msi /q
Start-Sleep -s 120
C:\SharePoint\Software\OfficeToolsForVS2012RTW\bin\WebpiCmd.exe /install /products:OfficeToolsForVS2012RTW /XML:C:\SharePoint\Software\OfficeToolsForVS2012RTW\feeds\latest\webproductlist.xml /AcceptEula

Once everything finishes installing, it will look something like this:


Note: This tutorial was done and tested with version 4.6 of the Web Platform Installer. If you ever have errors with an older version, please tell me and I will update the article!

NotePad++

To Install NotePad++, download the Notepad++ installer file from http://notepad-plus-plus.org/download/v6.5.html and save it in C:\SharePoint\Software\NotePad++

Run the Following Command:

cd C:\SharePoint\Software\NotePad++
.\npp.6.5.Installer.exe /S
NotePad++ is now installed!

Chrome

To Install Chrome, download the Chrome MSI file from here http://www.google.com/chrome/eula.html?msi=true and save it in C:\SharePoint\Software\Chrome

Run the following Command:

Cd C:\SharePoint\Software\Chrome
Msiexec /q /I GoogleChromeStandaloneEnterprise.msi

Google Chrome is now installed!

Firefox

To Install FireFox, download the full Executable Package of FireFox English Version from http://www.mozilla.org/en-US/firefox/all/ and save it as an executable with no spaces (preferably) in C:\SharePoint\Software\FireFox

Run the following Command:

cd C:\SharePoint\Software\FireFox
.\ffsetup.exe -ms

FireFox is now installed!

Microsoft SharePoint Designer 2013

SharePoint Designer 2013 is probably the most complicated out of the optional software. First of all, download the 64 bit executable from http://www.microsoft.com/en-ca/download/details.aspx?id=35491. Then, using PowerShell navigate to the folder where it was downloaded and run the following command:

.\sharepointdesigner_64bit.exe /extract:C:\SharePoint\Software\SPDesigner

You should now have something like this:

We will now go back to PowerShell and run the following command:

cd C:\SharePoint\Software\SPDesigner
.\setup.exe /admin

The Microsoft Office Customization Tool will open and ask us to select what file we want to prepare! We will chose the only available product we have!

In the Setup > Licensing and user interface tab, select the “I accept the terms in the License Agreement” as well as set the display level to “None”

Afterwards, we will go to File > Save As, and we will save it in the C:\SharePoint\Software\SPDesigner\Updates folder and we will call it adminfile.msp !

We will then open PowerShell and run the following commands:

cd C:\SharePoint\Software\SPDesigner
.\setup.exe /adminfile updates\adminfile.msp

SharePoint Designer 2013 is now installed!

SMTP4DEV, ULSViewer & HNSC Creator

The SMTP4Dev, ULSViwer and SharePoint Host named Site Collection (HNSC) Creator are “standalone” programs that do not require installation and that’s why I grouped them together! First of all, download all of them from the following links and paste the extracted executable in C:\SharePoint\Software\Standalone

It should then look something like this:

You can also add any other standalone program that you need! After we’re done, we will run the following command:

Copy-Item C:\SharePoint\Software\StandAlone\* C:\Users\sp_admin\Desktop

It will then look something like this on your desktop!

Summary

In this part of the tutorial, we installed Visual Studio 2012, Office Developer Tools for Visual Studio 2012, Google Chrome, FireFox, SharePoint Designer, NotePad++, as well as SMTP4Dev, ULSViewer and the SharePoint Host named Site Collection creator! To do that, we used a bunch of commands… now let’s group them into usable scripts!

Our First Script is to install Visual Studio 2012!

#Name: installvs2012.ps1
#Purpose: Installs Visual Studio 2012
cd C:\SharePoint\Software\VisualStudio2012
.\vs_ultimate.exe /full /noweb /quiet /p ProductKey=" XXXX-XXXX-XXXX-XXXX " /ForceRestart

The Second one is to install the Microsoft Office Developer Tools for Visual Studio 2012

#Name: installofficetools.ps1
#Purpose: Installs Microsoft Office Developer Tools for Visual Studio 2012
C:\SharePoint\Software\OfficeToolsForVS2012RTW\WebPlatformInstaller_amd64_en-US.msi /q
Start-Sleep -s 120
C:\SharePoint\Software\OfficeToolsForVS2012RTW\bin\WebpiCmd.exe /install /products:OfficeToolsForVS2012RTW /XML:C:\SharePoint\Software\OfficeToolsForVS2012RTW\feeds\latest\webproductlist.xml /AcceptEula

The third and final one is to install all the other optional software!

#Name: installoptionalsoftware.ps1
#Purpose: Installs Notepad++, Chrome, FireFox, Designer, SMTP4DEV, ULSViewer & HNSC Creator
Write-Host "Installing NotePad++"
cd C:\SharePoint\Software\NotePad++
.\npp.6.5.Installer.exe /S
Start-Sleep -s 120
Write-Host "Installing Goolge Chrome"
Cd C:\SharePoint\Software\Chrome
Msiexec /q /I GoogleChromeStandaloneEnterprise.msi
Start-Sleep -s 120
Write-Host "Installing FireFox"
cd C:\SharePoint\Software\FireFox
.\ffsetup.exe -ms
Start-Sleep -s 120
Write-Host "Installing SharePoint Designer 2013"
cd C:\SharePoint\Software\SPDesigner
.\setup.exe /adminfile updates\adminfile.msp
Start-Sleep -s 200
Write-Host "Copying standalone programs"
Copy-Item C:\SharePoint\Software\StandAlone\* C:\Users\sp_admin\Desktop
Write-Host "DONE"

We have now installed all the software needed to Develop for SharePoint 2013. Here is how your SharePoint folder should look like:

Head over to Basic Optimizing and Summary

Share this post with your followers on twitter:

Leave  a comment and don’t forget to like us on Facebook here and to follow me on Google+ here and on Twitter here  for the latest news and technical articles on SharePoint.  Also, don’t forget to check out SharePoint Community.Net for more great SharePoint Content

No ratings yet.

Please rate this

Last week I was confronted with a pretty big SharePoint 2013 Apps Error. After setting up the Environment using my own guide that worked almost a dozen times before, whenever I entered an application, the CSS didn’t load properly and the app looked something like this:

SharePoint 2013 Apps do not load CSS

I did check the network monitor when loading and at first, I have found this:

So I thought it was getting a 404 somewhere… however on a second app there were absolutely no 404’s. I then turned on verbose logging and watched ULS in real time and found the following Logs. I know it’s quite a pack of ULS logs, however they will help future victims of this bug find this post!

defaultcss.ashx: using elevated codepath to get css file or other resource because the non-elevated code path failed to get it. System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
at Microsoft.SharePoint.SPGlobal.HandleUnauthorizedAccessException(UnauthorizedAccessException ex)
at Microsoft.SharePoint.Library.SPRequest.SetWebMetainfo(String bstrUrl, Object varMetainfo)
at Microsoft.SharePoint.SPWeb.UpdateProperties(StringDictionary data)
at Microsoft.SharePoint.SPWeb.set_MasterDefaultCss(String value)
at Microsoft.SharePoint.SPWeb.get_MasterDefaultCss()
at Microsoft.SharePoint.ApplicationPages.DefaultCss.GetResourceUrl(SPWeb web, Boolean getResource)
at Microsoft.SharePoint.ApplicationPages.DefaultCss.ProcessRequest(HttpContext context)

System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)), StackTrace:
at Microsoft.SharePoint.SPWeb.UpdateProperties(StringDictionary data)
at Microsoft.SharePoint.SPWeb.set_MasterDefaultCss(String value)
at Microsoft.SharePoint.SPWeb.get_MasterDefaultCss()
at Microsoft.SharePoint.ApplicationPages.DefaultCss.GetResourceUrl(SPWeb web, Boolean getResource)
at Microsoft.SharePoint.ApplicationPages.DefaultCss.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
at System.Web.HttpApplication.PipelineStepManager.ResumeSteps(Exception error)
at System.Web.HttpApplication.BeginProcessRequestNotification(HttpContext context, AsyncCallback cb)
at System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
at System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr pHandler, RequestNotificationStatus& notificationStatus)
at System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr pHandler, RequestNotificationStatus& notificationStatus)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)

SPRequest.OpenWeb: UserPrincipalName=, AppPrincipalName= ,bstrUrl=http://vladtest.domain.ca/My FAQ List

System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)), StackTrace:
at Microsoft.SharePoint.SPWeb.InitWeb()
at Microsoft.SharePoint.SPWeb.get_Title()
at Microsoft.SharePoint.SPSite.OpenWeb(Guid gWebId, Int32 mondoHint)
at Microsoft.SharePoint.ApplicationPages.DefaultCss.<>c__DisplayClass3.<ProcessRequest>b__0()
at Microsoft.SharePoint.SPSecurity.<>c__DisplayClass5.<RunWithElevatedPrivileges>b__3()
at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode)
at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(WaitCallback secureCode, Object param)
at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(CodeToRunElevated secureCode)
at Microsoft.SharePoint.ApplicationPages.DefaultCss.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
at System.Web.HttpApplication.PipelineStepManager.ResumeSteps(Exception error)
at System.Web.HttpApplication.BeginProcessRequestNotification(HttpContext context, AsyncCallback cb)
at System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
at System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr pHandler, RequestNotificationStatus& notificationStatus)
at System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr pHandler, RequestNotificationStatus& notificationStatus)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)

UnauthorizedAccessException for the request. 403 Forbidden will be returned. Error=Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
at Microsoft.SharePoint.SPGlobal.HandleUnauthorizedAccessException(UnauthorizedAccessException ex)
at Microsoft.SharePoint.Library.SPRequest.OpenWeb(String bstrUrl, String& pbstrServerRelativeUrl, String& pbstrTitle, String& pbstrDescription, String& pbstrTitleResourceId, String& pbstrDescriptionResourceId, Guid& pguidID, DateTime& pdtTimeCreated, String& pbstrRequestAccessEmail, UInt32& pwebVersion, Guid& pguidScopeId, UInt32& pnAuthorID, UInt32& pnLanguage, UInt32& pnLocale, UInt16& pnTimeZone, Boolean& bTime24, Int16& pnCollation, UInt32& pnCollationLCID, Int16& pnCalendarType, Int16& pnAdjustHijriDays, Int16& pnAltCalendarType, Boolean& pbShowWeeks, Int16& pnFirstWeekOfYear, UInt32& pnFirstDayOfWeek, Int16& pnWorkDays, Int16& pnWorkDayStartHour, Int16& pnWorkDayEndHour, Int16& pnMeetingCount, Int32& plFlags, Boolean& bConnectedToPortal, String& pbstrPortalUrl, String& pbstrPortalName, Int32& plWebTemplateId, Int16& pnProvisionConfig, String& pbstrDefaultTheme, String& pbstrDefaultThemeCSSUrl, String& pbstrThemedCssFolderUrl, String& pbstrAlternateCSSUrl, String& pbstrCustomizedCssFileList, String& pbstrCustomJSUrl, String& pbstrAlternateHeaderUrl, String& pbstrMasterUrl, String& pbstrCustomMasterUrl, String& pbstrSiteLogoUrl, String& pbstrSiteLogoDescription, Object& pvarUser, Boolean& pvarIsAuditor, UInt64& ppermMask, Boolean& bUserIsSiteAdmin, Boolean& bHasUniquePerm, Guid& pguidUserInfoListID, Guid& pguidUniqueNavParent, Int32& plSiteFlags, DateTime& pdtLastContentChange, DateTime& pdtLastSecurityChange, String& pbstrWelcomePage, Boolean& pbOverwriteMUICultures, Boolean& pbMUIEnabled, String& pbstrAlternateMUICultures, Int32& plSiteSchemaMajorVersion, Int32& plSiteSchemaMinorVersion, Int32& plSiteSchemaBuildVersion, Int32& plSiteSchemaRevisionVersion, Int32& puiVersion, Int16& pnClientTag, Boolean& pfIsEvalSite, Guid& pgSourceSiteId, DateTime& pdtExpirationDate, Guid& pgEvalSiteId, Guid& pguidAppProductId, String& pbstrRemoteAppUrl, String& pbstrOAuthAppId, String& pbstrAppDatabaseName, Guid& pgAppDatabaseServerReferenceId, String& pbstrAppDatabaseTargetApplicationId, String& pbstrAppWebDomainId, Int32& plUpgradeFlags, DateTime& pdtReminderDate, UInt64& pmaskDeny)
at Microsoft.SharePoint.SPWeb.InitWeb()
at Microsoft.SharePoint.SPWeb.get_Title()
at Microsoft.SharePoint.SPSite.OpenWeb(Guid gWebId, Int32 mondoHint)
at Microsoft.SharePoint.ApplicationPages.DefaultCss.<>c__DisplayClass3.<ProcessRequest>b__0()
at Microsoft.SharePoint.SPSecurity.<>c__DisplayClass5.<RunWithElevatedPrivileges>b__3()
at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode)
at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(WaitCallback secureCode, Object param)
at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(CodeToRunElevated secureCode)
at Microsoft.SharePoint.ApplicationPages.DefaultCss.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Application error when access /_layouts/15/defaultcss.ashx, Error=Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
at Microsoft.SharePoint.SPGlobal.HandleUnauthorizedAccessException(UnauthorizedAccessException ex)
at Microsoft.SharePoint.Library.SPRequest.OpenWeb(String bstrUrl, String& pbstrServerRelativeUrl, String& pbstrTitle, String& pbstrDescription, String& pbstrTitleResourceId, String& pbstrDescriptionResourceId, Guid& pguidID, DateTime& pdtTimeCreated, String& pbstrRequestAccessEmail, UInt32& pwebVersion, Guid& pguidScopeId, UInt32& pnAuthorID, UInt32& pnLanguage, UInt32& pnLocale, UInt16& pnTimeZone, Boolean& bTime24, Int16& pnCollation, UInt32& pnCollationLCID, Int16& pnCalendarType, Int16& pnAdjustHijriDays, Int16& pnAltCalendarType, Boolean& pbShowWeeks, Int16& pnFirstWeekOfYear, UInt32& pnFirstDayOfWeek, Int16& pnWorkDays, Int16& pnWorkDayStartHour, Int16& pnWorkDayEndHour, Int16& pnMeetingCount, Int32& plFlags, Boolean& bConnectedToPortal, String& pbstrPortalUrl, String& pbstrPortalName, Int32& plWebTemplateId, Int16& pnProvisionConfig, String& pbstrDefaultTheme, String& pbstrDefaultThemeCSSUrl, String& pbstrThemedCssFolderUrl, String& pbstrAlternateCSSUrl, String& pbstrCustomizedCssFileList, String& pbstrCustomJSUrl, String& pbstrAlternateHeaderUrl, String& pbstrMasterUrl, String& pbstrCustomMasterUrl, String& pbstrSiteLogoUrl, String& pbstrSiteLogoDescription, Object& pvarUser, Boolean& pvarIsAuditor, UInt64& ppermMask, Boolean& bUserIsSiteAdmin, Boolean& bHasUniquePerm, Guid& pguidUserInfoListID, Guid& pguidUniqueNavParent, Int32& plSiteFlags, DateTime& pdtLastContentChange, DateTime& pdtLastSecurityChange, String& pbstrWelcomePage, Boolean& pbOverwriteMUICultures, Boolean& pbMUIEnabled, String& pbstrAlternateMUICultures, Int32& plSiteSchemaMajorVersion, Int32& plSiteSchemaMinorVersion, Int32& plSiteSchemaBuildVersion, Int32& plSiteSchemaRevisionVersion, Int32& puiVersion, Int16& pnClientTag, Boolean& pfIsEvalSite, Guid& pgSourceSiteId, DateTime& pdtExpirationDate, Guid& pgEvalSiteId, Guid& pguidAppProductId, String& pbstrRemoteAppUrl, String& pbstrOAuthAppId, String& pbstrAppDatabaseName, Guid& pgAppDatabaseServerReferenceId, String& pbstrAppDatabaseTargetApplicationId, String& pbstrAppWebDomainId, Int32& plUpgradeFlags, DateTime& pdtReminderDate, UInt64& pmaskDeny)
at Microsoft.SharePoint.SPWeb.InitWeb()
at Microsoft.SharePoint.SPWeb.get_Title()
at Microsoft.SharePoint.SPSite.OpenWeb(Guid gWebId, Int32 mondoHint)
at Microsoft.SharePoint.ApplicationPages.DefaultCss.<>c__DisplayClass3.<ProcessRequest>b__0()
at Microsoft.SharePoint.SPSecurity.<>c__DisplayClass5.<RunWithElevatedPrivileges>b__3()
at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode)
at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(WaitCallback secureCode, Object param)
at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(CodeToRunElevated secureCode)
at Microsoft.SharePoint.ApplicationPages.DefaultCss.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)


The important part to see is that in the following logs, we have acces denied on an important app file which is defaultcss.ashx

defaultcss.ashx: using elevated codepath to get css file or other resource because the non-elevated code path failed to get it. System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
Application error when access /_layouts/15/defaultcss.ashx, Error=Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
UnauthorizedAccessException for the request. 403 Forbidden will be returned. Error=Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

Also by watching it with Fiddler I had realized there were 403 errors on that file

Screenshot Property of Tobias Wolter because I forgot to take one myself!

Now at least, I had some ULS logs to research on, however the only person I found had this bug had written about it in German and Google translate did a really poor job . That person is Tobias Wolter, and if you understand German, you can also read about this topic on his blog here: http://www.standard-cloud.com/2013/04/sharepoint2013-apps-konfiguration-bug/ .

I tried excluding the permission problem, so I gave ALL SharePoint Service Accounts Full admin on SP Server, SysAdmin on SQL, and full control on Web Application. Did IISReset and reboots but nothing!

To continue debugging, I also tried using ProcMon to find what account was trying to get that file, however it had SUCCES on accessing it… So that didn’t help!

Then, when I was about to give up I finally found the solution. To put you in context, before this moment, when I was installing a SharePoint 2013 farm, I had two Application Pools as per *old* SharePoint Best Practices. One for the MySites and one for the rest of the Web Applications. I wasn’t a firm believer in the Host named Site Collections Model yet. However, I was well aware that Microsoft is advising us to only have 1 Web Application (= 1 App Pool = 1 App Pool Account) in SharePoint 2013.

Solution

Now, as you know if you set up apps in SharePoint 2013, you need an “Empty Host Header” Web application. Well I found out that apps will work only in Web Applications that will use the same Application Pool Account as the Empty Host Header Web Application. To make it safe, I suggest you put it in the same pool (that’s what I did) and it worked. In other words… if you have this error and you’re reading this blog post it’s because you use two application pool accounts! You need to go back to using only one! In other words

I am really glad I finally found the problem and wanted to thank the following people for providing great ideas on twitter and SharePoint Community!

Thank you!

Leave a comment and don’t forget to like us on Facebook here and to follow me on Google+ here and on Twitter here  for the latest news and technical articles on SharePoint.  Also, don’t forget to check out SharePoint Community.Net for more great SharePoint Content

No ratings yet.

Please rate this

Introduction

Creating a SharePoint Development Virtual Machine is something you might have to do quite a few times as a Developer. Even if it’s a pretty easy process, on a slow machine it can easily kill 4-5 hours of your day only to install SQL, SharePoint, Visual Studio and all the others tools you might need to get started. What if you could just script it so it’s all done automatically while you go take coffee, chat on SharePoint Community or whatever else you enjoy doing? In this tutorial we will learn how to build a script that we will keep using for as long as you keep developing on SharePoint 2013. The tutorial will be split in a few sections since in order to keep them focused and short, and at the end they will all be published in a downloadable PDF. I strongly encourage you to not only copy the scripts, but actually read the blog posts of why I did them like this and there are some parts where you will need to work as well!

Sections:

  1. Introduction & Prerequisites & Creating the Domain and Service Accounts
  2. Installing software prerequisites + SQL
  3. Installing SharePoint 2013
  4. Installing Visual Studio 2012 and Optional Software
  5. Basic Optimizing and Summary
  6. Advanced Optimizing of the scripts! (You are here)
  7. An eBook Guide of the 6 sections and a video! (19/11/2013)

Installing SharePoint 2013

The Installation of SharePoint 2013 will basically be done in two steps. The first step is, of course, preparing our source package and configuration, and the second step is installing it. Both those steps will be done with the help of two great tools done by Brian Lalancette. The first one is AutoSPInstaller that you can download here: https://autospinstaller.codeplex.com/ and the second one is AutoSPSourceBuilder that you can download here: https://autospsourcebuilder.codeplex.com .

First, let’s download AutoSPInstaller, and put the “SP” Folder in C:\SharePoint . Now, let’s download AutoSPSourceBuilder and extract it in C:\SharePoint Again. The folder should look something like:

SharePoint 2013 Development Environment Tutorial

Next thing you have to do is mount the SharePoint 2013 ISO file and open PowerShell as an administrator.

Run the following script (If you want to add language packs to your install you can now! Make sure to read the tools documentation if you modify stuff! Also, for this step you will need an internet connection so it can download the prerequisites! However, once we have them we won’t need them anymore for future Virtual Machines.

cd C:\SharePoint\AutoSPSourceBuilder
.\AutoSPSourceBuilder.ps1 -Destination "C:\SharePoint\SP\2013" -GetPrerequisites $true

The script will start copying the Source Files from your ISO in the right folder in C:\SharePoint , as well as downloading the pre-requisites so they are offline in the future! It will look something like this:

When Asked to enter a Cumulative Update, just press Enter, we don’t want to slipstream the updates using the old process, we will use the new “AutoSPInstaller” way!

While it runs, you can download the March 2013 PU from this link: http://download.microsoft.com/download/5/1/C/51CA768E-C79E-41BA-91D4-7F7D929B0BFE/ubersrvsp2013-kb2767999-fullfile-x64-glb.exe

And the August 2013 Cumulative Update from this link: http://hotfixv4.microsoft.com/Microsoft%20SharePoint%20Server%202013/sp1/ubersrv2013kb2817616fullfilex64glb/15.0.4535.1000/free/466901_intl_x64_zip.exe

The March 2013 CU is already an .exe file, however the August 2013 one is a zip, so you will have to extract it into the exe. After you do, copy both your executables and the .cab file into C:\SharePoint\SP\2013\Updates folder. It should look something like this :

When the AutoSPSourceBuilder finishes, it will have copied all the SharePoint 2013 Media in the C:\SharePoint\2013\SharePoint folder and all the prerequisites in C:\SharePoint\SP\2013\SharePoint\PrerequisiteInstallerFiles . Now that your media is prepared, you can actually delete the AutoSPSourceBuilder folder as we won’t be using it anymore. It will look something like this:

Now that our SharePoint Sources are ready, we can start configuring everything! Go in C:\SharePoint\SP\AutoSPInstaller and open “AutoSPInstallerInput.xml” with a notepad editor. You can also edit this file on your local machine since you probably have NotePad++ which makes modifying this document a lot easier! The Document is pretty well documented however I will go over with you with some settings we need to change. I will also show you a bit under an example of a configured AutoSPInstallerInput.xml that you can refer to incase you have any questions… so let’s start!

  1. change the “PIDKEY” value with your actual SharePoint 2013 Key :
  2. Change “OfflineInstall” to true:
  3. Change the “AutoAdminLogon” to true and enter the sp_admin password. This will make sure we aren’t prompted to reboot every time the Pre Req installer needs a reboot! :
  4. Change the “CertificateRevocationListCheck” to true. If we keep it enabled, it will slow down your VM when not connected to internet!:
  5. Enter the passphrase of the farm… Make sure it’s pretty complicated!

Tip to make configuration faster! Do a Find/Replace with Domain\ for vladdev\ (for example) and domain.com for vladdev.local (for example). This will avoid you writing in the domain every time!

From now on, I won’t tell you what to change on each line, since it’s very well documented in the XML file, however I will post you screenshots of “Sections”. The only thing I want to make sure you do is set the <DBServer> to localhost! This will make sure it will always pick the MSSQL instance!

PS: I will have deleted comments from my screenshots so I am able to show you more actual configuration on a smaller screenshot!

In the Logging Part, I changed the Path to C:\Logs\<logname> to make it easier to find them after! Won’t have to go to the long default path anymore!

For the Service Applications, the basic ones will only ask you if you want to provision or not… And some of them like “Search” And User profile will ask you for more detail! I will only show you the MMS, Search and User Profile Screnshots, use the comments in the XML to configure the rest if you need!

The SP_UserProfiles account currently does not have the necessary rights to sync users! You either have to give it the Replicating Directory Changes Permission (Click here for tutorial) OR, if you want an “easier” way… Just use the SP_Admin account! It’s already a local(domain) admin!

The rest of the Service Applications can be configured as you wish!

After you’re done configuring the file, run the AutoSPInstallerLaunch.bat file. It will launch a CMD window as well as a PowerShell one and will look something like this!

And then it will install the prerequisites, Binaries, Updates and configure everything as you told it to in the AutoSPInstallerInput.XML. Here are some screenshots of it running.

d

And when the SharePoint 2013 installation is done, it will open the Web Applications and Central Administration in the Background

Summary

This Part of the Guide has been quite complicated, however we managed to install SharePoint 2013 entirely scripted! The fun part is now that you already got your sources ready, so you won’t have to redo the “Source Preparation” ever again. Also, since it’s a development machine, the AutoSPInstallerInput.XML will probably never change between the installs, so now you got that forever as well! One thing that isn’t “cool” now is that we have to go to “C:\SharePoint\SP\AutoSPInstaller” to launch the script and not launch it from C:\SharePoint like all the other ones! So let’s create this script and put it in C:\SharePoint

#Name: installSharePoint.ps1
#Purpose: Installs SharePoint
cd C:\SharePoint
.\SP\AutoSPInstaller\AutoSPInstallerLaunch.bat

Your new C:\SharePoint should look something like this :

So Until now in the 3 Sections that we completed we:

  • Changed our PC Name and Created a Domain
  • Installed Prerequisite Software and Features
  • Prepared our ConfigurationFile.Ini for future SQL installs and SQL install Script
  • Prepared our SharePoint 2013 Sources and AutoSPInstallerInput.xml file for future installs!
  • And we Also installed SQL 2012 and SP2013 of course!

Now it’s time to install the other software! Head over to Installing Visual Studio 2012 and Optional Software 

Share this post with your followers on twitter:

Leave  a comment and don’t forget to like us on Facebook here and to follow me on Google+ here and on Twitter here  for the latest news and technical articles on SharePoint.  Also, don’t forget to check out SharePoint Community.Net for more great SharePoint Content

No ratings yet.

Please rate this

If you currently have a SharePoint 2010 Environment that is not up to Service Pack 2, you are out of luck since Microsoft pulled the plug on the RTM language packs and replaced them with Language Pack + SP2 ones. In this post we’re going to take a look at how to deploy a new language to a pre-sp2 SharePoint 2010 environment.

SharePoint 2010 RTM Language Packs

The first thing I tested obviously is install the language pack on a SharePoint 2010 that is only patched up to Service Pack 1…and to my surprise… it actually worked and the Configuration Wizard didn’t give me any “version mismatch” errors. However, when you look at the patch levels you realize that it’s way off. The Language Pack is now at 14.0.7015.1000 (SP2) while the rest of SharePoint 2010 is at 14.0.6029 (SP1). In my opinion, the Configuration Wizard should not have worked, however it did and strangely I was able to create a new Site Collection with a French Template.

Even if it works, I don’t think you should leave it like that and you should follow the following procedure in order to get a proper Language Pack Installation. Start with the downloaded LanguagePack executable, in our case “ServerLanguagePack_SP2_fr-fr”. Open a Command prompt window as an administrator and navigate to the place where your executable is and run this command

ServerLanguagePack_SP2_fr-fr /extract:C:\temp\

After it’s done, you should have a dialog like this in the language of your Language Pack.

Now if we go in C:\Temp, we will see the extracted language pack!

The only difference between this language pack and the RTM language Pack is what’s inside the Updates folder! Notice they are all modified in July 2013… when the SP2 came out! Once you delete those files, you actually have an RTM language pack ready to install.

If you want to slipstream Service pack 1 of the Language Pack in the install, you can actually download it and extract it (Same procedure as for the LP) in the Updates Folder. It will look something like this:

And you will have stuff again in C:\Temp\Updates. (Notice they are all last modified in 2011… you should have no more 2013 there) Now to install the language pack, just run the setup.exe in C:\Temp and then run the Configuration Wizard and the Language Pack will be at SP1 level.

Share this post with your followers on twitter:

Leave  a comment and don’t forget to like us on Facebook here and to follow me on Google+ here and on Twitter here  for the latest news and technical articles on SharePoint.  Also, don’t forget to check out SharePoint Community.Net for more great SharePoint Content

No ratings yet.

Please rate this

Introduction

Creating a SharePoint Development Virtual Machine is something you might have to do quite a few times as a Developer. Even if it’s a pretty easy process, on a slow machine it can easily kill 4-5 hours of your day only to install SQL, SharePoint, Visual Studio and all the others tools you might need to get started. What if you could just script it so it’s all done automatically while you go take coffee, chat on SharePoint Community or whatever else you enjoy doing? In this tutorial we will learn how to build a script that we will keep using for as long as you keep developing on SharePoint 2013. The tutorial will be split in a few sections since in order to keep them focused and short, and at the end they will all be published in a downloadable PDF. I strongly encourage you to not only copy the scripts, but actually read the blog posts of why I did them like this and there are some parts where you will need to work as well!

Sections:

  1. Introduction & Prerequisites & Creating the Domain and Service Accounts
  2. Installing software prerequisites + SQL
  3. Installing SharePoint 2013
  4. Installing Visual Studio 2012 and Optional Software
  5. Basic Optimizing and Summary
  6. Advanced Optimizing of the scripts! (You are here)
  7. An eBook Guide of the 6 sections and a video! (19/11/2013)

Installing software prerequisites

We will do everything under the assumption that even if this virtual machine is installed with an internet connection, we would be able to install all the next ones completely offline. First thing that we need is the sxs folder from a Windows Server 2012 ISO File. We will need it to install .Net Framework 3.5

SharePoint 2013 Development Environment Tutorial

Copy the whole sxs folder to C:\SharePoint.

Now, run PowerShell as an Administrator and run the following command to install .Net Framework 3.5

Import-Module ServerManager
DISM.exe /Online /Enable-Feature /FeatureName:NetFx3 /All /LimitAccess /Source:"C:\SharePoint\sxs"

Next, you will probably connect to this Virtual machine with Remote Desktop, so let’s enable it!

(Get-WmiObject -Class "Win32_TerminalServiceSetting" -Namespace root\cimv2\terminalservices).SetAllowTsConnections(1)
(Get-WmiObject -class "Win32_TSGeneralSetting" -Namespace root\cimv2\terminalservices -Filter "TerminalName='RDP-tcp'").SetUserAuthenticationRequired(0)

For Remote Desktop and SQL to work properly without too much hassle, we will also disable the firewall!

netsh advfirewall set allprofiles state off

Next, let’s disable IE Enhanced Security…. As it’s really annoying.

Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}" -Name isinstalled -Value 0
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A8-37EF-4b3f-8CFC-4F3A74704073}" -Name isinstalled -Value 0
Rundll32 iesetup.dll, IEHardenLMSettings,1,True
Rundll32 iesetup.dll, IEHardenUser,1,True
Rundll32 iesetup.dll, IEHardenAdmin,1,True
If (Test-Path "HKCU:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}")
{
Remove-Item -Path "HKCU:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}"
}
If (Test-Path "HKCU:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A8-37EF-4b3f-8CFC-4F3A74704073}")
{
Remove-Item -Path "HKCU:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A8-37EF-4b3f-8CFC-4F3A74704073}"
}
Remove-ItemProperty "HKCU:\SOFTWARE\Microsoft\Internet Explorer\Main" "First Home Page" -ErrorAction SilentlyContinue

Before the next reboot is required, we will add the SQL_Admin and SP_Admin accounts to the local administrator group… make sure you change the domain info!


$pcname = hostname
Set-ADGroup -Add:@{'Member'="CN=Sp_Admin,OU=SP Service Accounts,DC=vladdev,DC=local", "CN=Sql_Admin,OU=SQL Service Accounts,DC=vladdev,DC=local"} -Identity:"CN=Domain Admins,CN=Users,DC=vladdev,DC=local" -Server:"$pcname.vladdev.local"

We might want to install / test some client software in the future, so let’s add the Desktop Experience Feature!

Add-WindowsFeature Desktop-Experience
Restart-Computer

After the computer restarts, we will log in with the SQL_Admin account!

Installing SQL Server 2012

Everything until now was pretty straightforward and easy, especially since I gave you most of the scripts. However, installing SQL Server 2012 is not as easy and it will require some input from you! To Begin with, insert the SQL 2012 ISO (with SP1 Preferably) in the virtual machine, and let’s create a folder in C:\SharePoint called “SQLBinaries” and copy all the SQL Binaries inside it!

We won’t open Powershell right away… instead of me giving you all the script and configuration file which risks not working on your computer, I will show you step by step how to do it yourself! First, start setup.exe! Go in the Installation Tab and click on New SQL Server Instance. I won’t include every Screenshot, only those where you need to modify something.

The Minimum you need for the following screen is “Database Engine” and “Management Tools – Complete”

Do not Enter an Instance Name… It’s a Dev Environment!

Enter the Service Accounts we created in the earlier step and their good passwords!

Configure SQL in Mixed Mode and add SQL_Admin, SP_Admin and the “Domain Admins” group to the SQL Server Administrators.

And now we stop at this step! Do not click install!

You can see that on the bottom, we have a “Configuration File Path”. That’s the Configuration File we need, so go at the path there and copy the “ConfigurationFile.ini” file in C:\SharePoint\SQLBinaries . You can now cancel the Installation Wizard!

Now that we have everything configured in there, let’s see how we do it with PowerShell for the next times! Just fill the info for the following script!

cd c:\SharePoint
.\SQLBinaries\Setup.exe /ConfigurationFile=.\SQLBinaries\ConfigurationFile.INI /Q /Action=Install /IAcceptSQLServerLicenseTerms /SQLSVCPASSWORD=pass@word1 /AGTSVCPASSWORD=pass@word1 /sapwd=pass@word1

If you go in the Start Menu, you should now have a bunch of SQL tools. You can open the Management Studio if you want to start checking your SQL Configuration.

SQL is now setup!

Summary

In Part 2 of this tutorial, we enabled and disabled a bunch of Windows Features in order to make it easy for us to develop afterwards and to make sure everything installs smoothly. Furthermore we created the SQL Configuration file we will use in the future as well as install SQL. We only have two scripts we will use for future installations:

Script 1 that Enables all the features and installs .Net Framework 3.5

#Name: prereqsandfeatures.ps1
#Purpose: Installs Prerequisite Software and Features
#Disable Firewall
netsh advfirewall set allprofiles state off
#Disable IE Enhanced Security
Write-Host -ForegroundColor White " - Disabling IE Enhanced Security..."
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}" -Name isinstalled -Value 0
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A8-37EF-4b3f-8CFC-4F3A74704073}" -Name isinstalled -Value 0
Rundll32 iesetup.dll, IEHardenLMSettings,1,True
Rundll32 iesetup.dll, IEHardenUser,1,True
Rundll32 iesetup.dll, IEHardenAdmin,1,True
If (Test-Path "HKCU:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}")
{
Remove-Item -Path "HKCU:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}"
}
If (Test-Path "HKCU:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A8-37EF-4b3f-8CFC-4F3A74704073}")
{
Remove-Item -Path "HKCU:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A8-37EF-4b3f-8CFC-4F3A74704073}"
}
Remove-ItemProperty "HKCU:\SOFTWARE\Microsoft\Internet Explorer\Main" "First Home Page" -ErrorAction SilentlyContinue
#Enable Remote Desktop
(Get-WmiObject -Class "Win32_TerminalServiceSetting" -Namespace root\cimv2\terminalservices).SetAllowTsConnections(1)
(Get-WmiObject -class "Win32_TSGeneralSetting" -Namespace root\cimv2\terminalservices -Filter "TerminalName='RDP-tcp'").SetUserAuthenticationRequired(0)
#Add .Net FrameWork
Import-Module ServerManager
DISM.exe /Online /Enable-Feature /FeatureName:NetFx3 /All /LimitAccess /Source:"C:\SharePoint\sxs"
#add SPAdmin and SQL Admin to Local(Domain) Administrators
$pcname = hostname
Set-ADGroup -Add:@{'Member'="CN=Sp_Admin,OU=SP Service Accounts,DC=vladdev,DC=local", "CN=Sql_Admin,OU=SQL Service Accounts,DC=vladdev,DC=local"} -Identity:"CN=Domain Admins,CN=Users,DC=vladdev,DC=local" -Server:"$pcname.vladdev.local"
#Enable Desktop Experience
Add-WindowsFeature Desktop-Experience
Restart-Computer

Script #2 which installs SQL!

#Name: installsql.ps1
#Purpose: Installs SQL
cd c:\SharePoint
.\SQLBinaries\Setup.exe /ConfigurationFile=.\SQLBinaries\ConfigurationFile.INI /Q /Action=Install /IAcceptSQLServerLicenseTerms /SQLSVCPASSWORD=pass@word1 /AGTSVCPASSWORD=pass@word1 /sapwd=pass@word1
shutdown -l

We can now log on with SP_Admin and head over to Part 3: Installing SharePoint 2013 

Share this post with your followers on twitter:

Leave  a comment and don’t forget to like us on Facebook here and to follow me on Google+ here and on Twitter here  for the latest news and technical articles on SharePoint.  Also, don’t forget to check out SharePoint Community.Net for more great SharePoint Content

No ratings yet.

Please rate this

Introduction

Creating a SharePoint Development Virtual Machine is something you might have to do quite a few times as a Developer. Even if it’s a pretty easy process, on a slow machine it can easily kill 4-5 hours of your day only to install SQL, SharePoint, Visual Studio and all the others tools you might need to get started. What if you could just script it so it’s all done automatically while you go take coffee, chat on SharePoint Community or whatever else you enjoy doing? In this tutorial we will learn how to build a script that we will keep using for as long as you keep developing on SharePoint 2013. The tutorial will be split in a few sections since in order to keep them focused and short, and at the end they will all be published in a downloadable PDF. I strongly encourage you to not only copy the scripts, but actually read the blog posts of why I did them like this and there are some parts where you will need to work as well! This Guide will show you how to install the following:

  • Microsoft SharePoint Server 2013 – August 2013 CU (Also show you how to install future ones)
  • Microsoft SQL Server 2012 + SP1
  • Microsoft Visual Studio 2012 + All the developers tools needed for SP 2013

Optional extra software:

  • Microsoft SharePoint Designer 2013
  • Google Chrome
  • Firefox
  • NotePad++
  • Smtp4dev
  • ULSViewer
  • HNSC Creator

Sections:

  1. Introduction & Prerequisites & Creating the Domain and Service Accounts
  2. Installing software prerequisites + SQL
  3. Installing SharePoint 2013
  4. Installing Visual Studio 2012 and Optional Software
  5. Basic Optimizing and Summary
  6. Advanced Optimizing of the scripts! (You are here)
  7. An eBook Guide of the 6 sections and a video! (19/11/2013)

Prerequisites

  • A Windows Server 2012 Virtual Machine
  • The Virtual Machine should have 2+ Cores (to avoid SharePoint 2013 Installation Error)
  • 1 Private Network Card attached to the virtual machine. Do not add your External card with internet connection right away, I will tell you when you can!
  • All the Binaries and Licenses for the software you want to install.

Creating the Domain and Service Accounts

Now that the Windows Server 2012 Virtual Machine is installed, the first thing we need to do is set the Execution Policy to Unrestricted. So, we will run this command:

Set-ExecutionPolicy unrestricted

Also, you can optionally turn off UAC to avoid annoying prompts on the development machine with this command New-ItemProperty -Path HKLM:Software\Microsoft\Windows\CurrentVersion\policies\system -Name EnableLUA -PropertyType DWord -Value 0 -Force Then first need to change the PC name to something understandable! So we will run this command (Don’t forget to change the PC Name to whatever you want):

$pcname = "DevMachine1"
Rename-Computer -NewName $pcname -force

Next, we will set our private network card to a static IP. If you don’t, it will give errors later when creating the new forest. We set it to a static IP with this script:

$netadapter = Get-NetAdapter -Name Ethernet
$netadapter | Set-NetIPInterface -Dhcp Disabled
$netadapter | New-NetIPAddress -IPAddress 192.168.110.5 -PrefixLength 24
Set-DnsClientServerAddress -InterfaceAlias "Ethernet" -ServerAddresses "192.168.110.5"

Afterwards, we will Install the Active Directory Domain Services Role and Management tools, and restart the computer to make sure the NameChange finishes successfully.

Import-Module Servermanager
Add-WindowsFeature -Name "ad-domain-services" -IncludeAllSubFeature -IncludeManagementTools
Restart-Computer

After the computer restarts, log in with the administrator account and we will finally create the new forest and domain. The Script is the following (make sure you change the “vladdev.local” and “vladdev” for domain you wish to have)

Import-Module ADDSDeployment
Install-ADDSForest <code>
-CreateDnsDelegation:$false </code>
-DatabasePath "C:\Windows\NTDS" <code>
-DomainMode "Win2012" </code>
-DomainName "vladdev.local" <code>
-DomainNetbiosName "VLADDEV" </code>
-ForestMode "Win2012" <code>
-InstallDns:$true </code>
-LogPath "C:\Windows\NTDS" <code>
-NoRebootOnCompletion:$false </code>
-SysvolPath "C:\Windows\SYSVOL" <code>
-Force:$true

The computer will now restart, and will ask you to re-login, but now it’s a Domain Controller (You can now add your internet connection for the rest of the tutorial )! We now need to create our SharePoint 2013 Service Accounts. To easily make that scripted, you should download the SharePoint 2013 Service Account Creator tool from CodePlex. When this tutorial was made, the tool was in version 1.5, so if the latest version is not 1.5 make sure you check if anything changed between then and now! What we are also going to do is create a folder on the C drive called “SharePoint” (C:\SharePoint). It’s very important to call it exactly like that because we will hardcode it in PowerShell to allow easier automation. So after we download and extract the tool in C:\SharePoint it should look like this: SharePoint 2013 Development Environment Tutorial We will open PowerShell like an Administrator, and run the following script to create the accounts:

cd c:\SharePoint
.\sp2013serviceaccounts.ps1 -Level high -SPOU "SP Service Accounts" -SQLOU "SQL Service Accounts" -SQLLevel high -OptionalAccounts $true

Then, the script will ask us to input the password for all the service accounts. Since it’s a Development environment, we can give all the accounts the same password, so for example I want it to be “pass@word1” and Press Enter.

Now, the PowerShell script should run fine and the result should be something like this:

And, if you go check out the Active Directory Users and Computers, you should now have two new Organizational Units (OU) for Service Accounts called “SP Service Accounts” and “SQL Service Accounts” with a bunch of users in them

You might ask yourself why we don’t run everything under 1 user, since it’s a development machine… In my opinion a development machine should be as similar to a production one as possible and therefore running your code with only 1 account and many accounts may make you think works perfectly, but will not work in a more secure environment.

Summary of Part 1

In part 1 of the tutorial, we ran a bunch of PowerShell commands, but we can easily create only two scripts with them to make it easier to run afterwards. The first command you will always need to run by hand is “Set-ExecutionPolicy unrestricted” and, you cannot get away from this one. Next, let’s group our commands in three scripts. The first script who will prepare the VM for the Domain Creation.

#Name: preparepc.ps1
#Purpose: Prepares the Virtual Machine for the Domain Creation
Set-ExecutionPolicy unrestricted
#turn off UAC
New-ItemProperty -Path HKLM:Software\Microsoft\Windows\CurrentVersion\policies\system -Name EnableLUA -PropertyType DWord -Value 0 -Force
#Set Static IP on Card
$netadapter = Get-NetAdapter -Name Ethernet
$netdapter | Set-NetIPInterface -Dhcp Disabled
$netadapter | New-NetIPAddress -IPAddress 192.168.110.5 -PrefixLength 24
Set-DnsClientServerAddress -InterfaceAlias "Ethernet" -ServerAddresses "192.168.110.5"
#Change PC Name
$pcname = "DevMachine1"
Rename-Computer -NewName $pcname -force
#Add AD DS Role
Import-Module Servermanager
Add-WindowsFeature -Name "ad-domain-services" -IncludeAllSubFeature -IncludeManagementTools
Restart-Computer

The second script who will create the domain!

#Name: createdomain.ps1
#Purpose: Creates the new Forest
# Windows PowerShell script for AD DS Deployment
Import-Module ADDSDeployment
Install-ADDSForest </code>
-CreateDnsDelegation:$false <code>
-DatabasePath "C:\Windows\NTDS" </code>
-DomainMode "Win2012" <code>
-DomainName "vladdev.local" </code>
-DomainNetbiosName "VLADDEV" <code>
-ForestMode "Win2012" </code>
-InstallDns:$true <code>
-LogPath "C:\Windows\NTDS" </code>
-NoRebootOnCompletion:$false <code>
-SysvolPath "C:\Windows\SYSVOL" </code>
-Force:$true

And the Third Script that Creates the Accounts

#Name: createaccounts.ps1
#Purpose: Creates Service Accounts
cd c:\SharePoint
.\sp2013serviceaccounts.ps1 -Level high -SPOU "SP Service Accounts" -SQLOU "SQL Service Accounts" -SQLLevel high -OptionalAccounts $true

Now that we got them, let’s create those scripts and put them into our C:\SharePoint Folder. It should look something like:

Head over to Next Sction:   Installing software prerequisites + SQL 

Share this post with your followers on twitter:

Leave  a comment and don’t forget to like us on Facebook here and to follow me on Google+ here and on Twitter here  for the latest news and technical articles on SharePoint.  Also, don’t forget to check out SharePoint Community.Net for more great SharePoint Content

5/5 (1)

Please rate this

SharePoint MVP 2013

Categories: Learning, Other
Comments: 9

Last Tuesday, October 1st, I had the honor to be awarded my first Microsoft Most Valuable Professional Award for SharePoint! While working on a nasty SharePoint Bug at a client, I got this in my email:

SharePoint MVP

It’s truly an honor to receive this award and be the fifth SharePoint MVP in Quebec! I wanted to thank all the members from the SharePoint Community for supporting me and hope to give even more time back to the community in the following years! I also encourage you of becoming a member of www.SharePoint-Community.net if you are not already one of the 4500 members of the online community! Also, Microsoft was nice and sent us this amazing Award Kit!

Once again, I am really humbled to receive this award and looking forward to doing and organizing more SharePoint events for the community! And here is a little video for some Monday humor 🙂

 

No ratings yet.

Please rate this

A lot of SharePoint 2013 developer environments do not have access to internet, therefor it is hard to install the Microsoft Office Developer Tools for Visual Studio 2012. When you download the Office Developer Tools from the MSDN website, you only get the small Microsoft Web Platform Installer (WPI) software that will then download the actual files from internet.

Fortunately, there is a little known feature of the WPI …. Offline mode! It gives you the possibility to download the tools, and then install them on any SharePoint 2013 Environment that you need using a simple command.

The Process is divided in two steps: The first step is to actually download all the files, and the second step is to install them on a virtual machine! For the first step, you will obviously need an internet connection, however you can do it on any machine!

Downloading the Office Developer Tools Package

The first thing you need to do is go to the MSDN Website here: http://msdn.microsoft.com/en-us/office/apps/fp123627.aspx and download the Microsoft Office Developer Tools for Visual Studio 2012 package.

Offline install of Office Developer Tools

Once it’s downloaded, open PowerShell and run the following command:

 WebpiCmd.exe /offline /products:OfficeToolsForVS2012RTW /Path:C:\Temp\OfficeToolsForVS2012RTW 

(you can change the path with whatever you want! It will automatically create the folder)

Offline install of Office Developer Tools

It will download a bunch of files and will put them into folders pretty cleanly! Also, by default, the WebPlatForm Installer commands are not installed, and if you don’t have an internet connection, you might get a nasty error! So what we will do is download the WebPi binaries from here: http://www.iis.net/learn/install/web-platform-installer/web-platform-installer-v4-command-line-webpicmdexe-rtw-release  (Direct Download: http://download.microsoft.com/download/7/0/4/704CEB4C-9F42-4962-A2B0-5C84B0682C7A/WebPlatformInstaller_amd64_en-US.msi  )

2013-10-05 15_34_46-OfficeToolsForVS2012RTW

You can now move this folder on a network share, or copy it on your offline environment. From now on, you won’t need an Internet Connection Anymore!

Installing Microsoft Office Developer Tools for Visual Studio 2012

After copying the “OfficeToolsForVS2012RTW” on your offline environment run the following command to install it: (Make sure to change the path to actually represent the real path you’ve chosen)

C:\SharePoint\Software\OfficeToolsForVS2012RTW\WebPlatformInstaller_amd64_en-US.msi /q
Start-Sleep -s 120
C:\SharePoint\Software\OfficeToolsForVS2012RTW\bin\WebpiCmd.exe /install /products:OfficeToolsForVS2012RTW /XML:C:\SharePoint\Software\OfficeToolsForVS2012RTW\feeds\latest\webproductlist.xml /AcceptEula

Offline install of Office Developer Tools

Once everything finishes installing, it will look something like this:

Offline install of Office Developer Tools

Note: This tutorial was done and tested with version 4.6 of the Web Platform Installer. If you ever have errors with an older version, please tell me and I will update the article!

Share this post with your followers on twitter:

Leave  a comment and don’t forget to like us on Facebook here and to follow me on Google+ here and on Twitter here  for the latest news and technical articles on SharePoint.  Also, don’t forget to check out SharePoint Community.Net for more great SharePoint Content

No ratings yet.

Please rate this