Monday 27 June 2011

Interested in Writing a Chapter for a SP2010 Community Book

About this book:  This book consists of standalone chapters written by various authors with real world experience of SharePoint 2010.  The content is predominantly non-technical allowing people involved and managing SharePoint 2010 projects to deploy SharePoint successfully within their business.

More info ...

Friday 24 June 2011

AntiVirus for Windows 2008 Developer Machines or WAF

Problem: My developer machine always runs Windows 2008 R2 x64.  I use the machine to browse the Internet and would like anti-virus installed.  No workstation based anti-virus will install on Windows 2008 Sever.

Initial Hypothesis: All the vendors that provide Anti-virus for Windows 2008 are expensive and are Server based anti-virus software whereas I am using my developer machine to surf and occasionally bring on files so I only need workstation based anti-virus.  Unfortunately I have never found a regular anti-virus that runs on Windows 2008 until now ... and best of all it's free and from Microsoft.

Resolution:  Use "Microsoft Security Essentials"
http://www.microsoft.com/en-gb/security_essentials/default.aspx

List of anti-virus plug ins

Update: 04 Sept 2013 - Antivirus and SharePoint 2013 (Spencer Harbar)

Update: 31 May 2022 - WAF sometimes don't have a anti-virus or cost a lot.  This is a simple approach to use a Linux container to provide an Open API endpoint to programmatically allow files and links to be scanned.
"The SWS Virus Scan Container project leverages ClamAV docker image and provides a REST API over it, which can be used to scan files and URLs. This container image is compatible with Azure Web apps for Containers and could also be run within other orchestrators like Kubernetes (and AKS)."


Thursday 23 June 2011

SP2010 install using AutoSPInstaller from PowerGUI

Problem: I want to install SharePoint 2010 using Brian Lala's AutoSPInstaller codeplex project however, I want to be able to see values and debug using PowerShell

Resolution:
Ensure AutoSPInstaller is setup correctly and PowerGUI is installed.  Correct setup is shown below.  Ensure that the xml file is named correctly.

Tip: Windows has a built in graphical debuggger for PowerShell called ISE Editor
http://blogs.msdn.com/b/powershell/archive/2009/01/19/debugging-powershell-script-using-the-ise-editor.aspx
PS> c:\SP2010\AutoSPInstaller\AutoSPInstallerMain.ps1 c:\SP2010\AutoSPInstaller\AutoSPInstallerInput-WIN-2C5PI8TSRPA.xml

Press F5 or the arrow to debug.  I have all the .ps1 files in the PowerGUI editor and add break points. 

Note.  If you hit a break point and press F5 once you are debugging, PowerGUI will not stop at the next break point.  F10 will take you to your next breakpoint or where the next error is trapped.

Wednesday 22 June 2011

SP2010 CU April 2011

Overview: Cumulative Update for SharePoint 2010 is the latest CU for SP2010 Server. The CU can be applied to an existing far or added be part of the install using AutoSPInstaller for new installations.

SharePoint Server 2010 cumulative update package  can be found here.  http://support.microsoft.com/default.aspx?scid=kb;EN-US;2512800

Installation:  You need to request the file from the link list above.  Download the file to your local machines (It's about 600MB).
For an update simple extract the from the file 432209_intl_x64_zip.exe using the cmd>432209_intl_x64_zip.exe /extract:.\

 If you want to include the CU in a new install using AutoSPInstaller, you will need to extract the .msp files from office2010-kb2512800-fullfile-x64-glb.exe /extract:.\
And place the msp files inside the approriate directory in you AutoSPInstaller directory.


DCPromo

Migrate Physical dev env to VMWare

Problem:  I have a laptop that boots Windows 2008 R2 and is my based SP2010 dev machine.  I need the machine to be available on a PC will additional memory using virtualisation.

Initial Hypothesis:  I could take an Acronis image of the laptop and then duel boot the the PC but it's far easier to do a P2V (Physical to Virtual) conversion and run the new image using VMWare workstation.

Resolution:
Install VMWare vCenter Converter Standalone client.  Open the VMWare converter application.
 Select "Convert Machine"
 Follow the steps as shown below:

 Finish the wizard and once the task is complete you will see the screen as shown below:
Open VMWare Workstation (V7.1 is the version I used)
Open the virtual disk created by the P2V process and you will now have you VM running inside VMWare (vmdk extension).


SQL Name Pipes Error

Problem: When setting up a development machine, I install SQL before SharePoint.  When I try access SQL Server 2008 R2 using "SQL Server Management Sudio", I get the error "provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server".

Initial Hypothesis: Named pipes are not enabled by default since SQL Server 2000, need to enable Named Pipes usinng "SQL Server Configuration Manager".

Resolution:
All Programs >> Microsoft SQL Server 2008 R2 >> Configuration Tools >> SQL Server Configuration Manager >> Enable both “TCP/IP” and “Named Pipes”.


More Info:
http://blogs.msdn.com/b/sql_protocols/archive/2007/03/31/named-pipes-provider-error-40-could-not-open-a-connection-to-sql-server.aspx

Friday 10 June 2011

DTAP for Office 365

Overview: Someone has asked me about DTAP environment's for Office 365 after reading my last post on DTAP for SharePoint. I should only comment on SharePoint Online's DTAP setup but the simple answer for Office 365 is to create a separate Office 365 account for each of your DTAP environments. So I would have at least 2 or 3 environments hosted on Office 365. In order of priority: Production, UAT, Pre-production, Testing. Development is done locally so CI and development machines are on-premise. SharePoint Online should use DTAP roughly as outline below.

SharePoint Online DTAP:
SharePoint 365 development should be done using a local development solutions using "SharePoint Sandbox Solutions" as this is as close to SP365 as you can get on a development environment. You can use a solution validator (as provided by multiple vendors & MS) or write your own to ensure your wsp deployment files meet all the additional SP365 requirements.
My Order would be:
  1. Development Environment - local Sp2010 dev machine where all code is deployed via wsps as a SharePoint Sandbox solution. On-premise hosted.
  2. Continuous Integration Environment - perform daily builds of TFS controlled code, TFS code must comply to the custom solution validator that will verify the code will run on SP Online. Candidate for removal as value can be fairly low in smaller deployments. On-premise hosted.
  3. UAT, testing and pre-production - for a small farm I would make this the environment as this will be identical to the setup of production, larger implementations could have 3 separate environments. This machine. Office 365 hosted.
  4. Production - only perform solution deployments once it has been tested on the pre-production environment.
Summary: Just because you are using the cloud, you should still follow good change control practices. You need to have more than a developer doing his best guess while deploying directly onto your SharePoint online production environment.

Additioanl Info:
Alan Richard's article on Lync 2010 via Office online for messaging, voice and video calls and meeting conferences

Wednesday 8 June 2011

DTAP for SharePoint

Overview: Development, Test, Acceptance and Production (DTAP).

To implement SharePoint solutions it is a good idea to have DTAP environments. DTAP can be as simple as 4 environments but I would recommend 5 or more separate environments for SharePoint. 
Development
The base development machines can be standalone VM's with self contained SQL databases, AD, FAST, and SharePoint.  Additional software would include: InfoPath, SharePoint designer, U2U, Fiddler, firefox, IE8 and more.  You should have TFS or a source control repository for all developers to check compiling code into. 

Continuous Integration (CI)
This box can range from very simple to a complex complete tear down rebuild on a daily basis with unit test.  At a minimum all code should be deployed daily.  All changes to CI and subsequent environments should be deployed via wsp's and PowerShell scripts.  Sometimes it is time efficient to write administration manual steps, this should be avoided where possible and if it is absolutely required, the documentation must be explicit and testable.

Testing
This environment is a build release, it is stable so testers can perform testing against a specific build.  Bugs should be documented (preferable in tied to source control changes).

Acceptance
End users should test the system pre go-live in this environment.  This phase can also be split into 2 environments namely: Acceptance and pre-production environments.  Used for user acceptance testing.

Production
This live system is only changed once the changes have gone thru change request management and have been deployed and tested on all the environments.  Pre-production should be as close a copy of the production environment as possible.  Production and pre-production must be kept as close as possible throughout the life time of the SharePoint farm.

Summary:
  • Never do changes directly on the production environment. 
  • Build a formalised change control process for SharePoint. 
  • Minimum of 3 environments for small farms is my base guideline. 
  • Environment changes should be done using wsp's and PowerShell not the UI where possible.

Powershell Setup for SharePoint Developers

Overview:  PowerGUI (from Quest Software) provides a PowerShell(PS) GUI to perform actions with minimal customisation you get Powershell with Intellesense and colour coding that is SharePoint aware.  Additionally you can plug in a Visual Studio (VS) plug-in (VSIX) that allows you to have PowerGUI functionality directly within you VS IDE.

1.> Install PowerGUI
1.1.> Download PowerGUI at http://www.powergui.org/ I installed version 2.4.0
1.2.> Install the PowerGUI msi on your development server

2.> Configure PowerGUI
2.1.> Open the PowerGUI application
2.2.> Add the Microsoft.SharePoint.PowerShell module as shown below:
3.> Write a PS script
3.1.> Open the "PowerGUI Script Editor" by clicking Tools > PowerGUI Script Editor
3.2.> Ensure your intellesense is working by typing "Get-SP", you will see the intellisense pick up the GET-SPSite cmdlet.
3.3> Add the following command and debug with a break point to see PowerGUI in action.  This will get all the Content Types associated to the RootWeb of a specific Site Collection.  Note the variables windows on the right hand side of the PowerGUI interfaces allows you to examine each of the variable objects declared in the script.
It's not full intellesense but it is a huge help to get you most of the way to writing custom PS.

4.> Add PowerGUI Visual Studio 2010
4.1.> Add the "PowerGUI VSX" through extension manager (VSIX) (Tools > Extension Manager > Online Gallery > Search for .. PowerGUI > Download.
4.2.> VS2010 will reboot, ensure VS2010 is open, click "View" > "PowerGUI Console".  You can use the console to write PS.
4.3.>  The VSIX also provides an SPI for adding PS Scripts as shown below:



Error msg:
PS E:\Windows\system32> Add-PSSnapin -Name Microsoft.SharePoint.PowerShell
Add-PSSnapin : The Windows PowerShell snap-in 'Microsoft.SharePoint.PowerShell' is not installed on this machine.

References:
PowerGUI and SharePoint 2010

Update: 19/07/2012 - I downloaded the latest version of PowerGui 3.2.0.2237 and tried to call SharePoint scripts arfer adding the SP add-in and got the following error:
Get-SPFarm : Microsoft SharePoint is not supported with version 4.0.30319.237 of the Microsoft .Net RuntimeFix navigate to: C:\Program Files (x86)\PowerGUI\ScriptEditor.exe.config and edit the xml.  I comented out the line telling PowerGui to use .NET 4.0.