Friday, May 21, 2010

Configuring Business Data Connectivity Services


Setup BDC with its own user, database and App pool
Start the service
You should have a pages host to contain the external content type definitions so you need to Configure /add an External Content Type Profile Page Host.
Create a new site collection (I use the same web application as the metadata hub created earlier)
Use the Publishing Pages Portal Template
Once published goto Central Admin ->Manage service applications –> Choose the BDC /BCS Service -> Click manage from the toolbar->Configure->Type in the URL of the site collection you created above. ie http://metadata.company.com/sites/ExternalContentTypesFinally assign administrators of the BDC Metadata Store by clicking on the Set MetaData Store Permissions.

To create external connections see this article

Multiple Authentication Methods in SharePoint 2010

There are new and exiting authentication methods such as Claims-based authentication in SharePoint 2010 which leads Microsofts product line in being the first Server to offer it.  This article introduces them
while (alive) { writeCode(); } : Multiple Authentication Methods in SharePoint 2010:

Thursday, May 20, 2010

Setup Managed Meta Data Hub for the Sharepoint 2010 farm

My personal notes to: Setup a Managed Meta Data Hub for the SP2010 farm
Create a new web applicationCreate a new user for this (and make sure its in the Managed accounts list with the correct permissions)

Create a new web application & make sure the "Document Sets metadata synchronization" web app. feature is activated (you can find this by managing the web application and choosing "manage features" from the tool bar.
always use NTLM to start with to test work and can switch after
Create a new site collection with a template of "Publishing ->publishing Portal"

Create the service application

Create a new "Service Application" from Central Admin->Application Managment->Service Applications->Manage Service applications

Click on the new button on the toolbar and choose "Managed Metadata Service"

Enter the name, SQL server and DB name.

You can either use the IIS Web application pool you created when you setup the web application and site above or create a new one with yet another new user account which has been added to the managed users

For the Content Type Hub use the URL of the site collection you setup above and then click ok.
Note: this will not start the Managed Metadata service, and you may see errors in the event log saying that this service is not running on any of the servers in your farm. You need to start the serice seperatly.
You start the service by Central Admin->System Settings->Servers->Manage services on server

Click start next to Managed Metadata Web Service

-------------

To check it is working and to manage the content goto Central Admin->Application Management-> Service Applications->manage Service Applications

You will see two entries for the Service, the first is the actual service and the second indented line is a proxy stub.

Click on the first line and choose Manage from the toolbar. This will bring you up the Term Store Mangement Tool where you can manually input Terms or import them using a CSV


Note: you may find errors if you do this straight away as certain timer services need to run to fully impliment this service. Gernerally I would always do an IISReset as well (well it cant hurt!)

Article for next steps setting up content types

SharePoint 2010 Connection Filter Logic

For SharePoint 2007 our MOSS profile sync uses the an LDAP query that filters which OU Users we dont't require -

ie User filter: (&(objectClass=user)(!Status:=System)(!UserAccountControl:1.2.840.113556.1.4.803:=2))

This assumes we want everyone except those with and AD attribute of Status=System (the UserAccountConrol setting excludes accounts disabled)

For SharePoint 2010 once you have setup your Sychronization Connection to include one or more OUs from AD, you can then add exclusion rules by clicking to the right of the Syncronization Connection and choosing Edit Connection Filters from the menu.

I didn't read the screen properly and just applied the same filter logic as SharePoint 2007 but after 4 hours of pain not getting the results I wanted, so I read what it said on the screen.
It says "Exclusion Filter for Users" - as such YOU MUST REVERSE YOUR LOGIC from SP2007!!

Thus to achieve the same result above you need:
ie User filter: (Status:=System)(UserAccountControl:Bit On:=2))

I'll read the screen next time - duh!

The importance of SharePoint 2010 Managed Service Application install order


SharePoint 2010 is very unforgiving when it comes to the configuration of its Managed Service Applications. Not only do all the security settings need to be just so, but the order of install needs to be just right.
Because of this sensitivity, after installing the binaries and getting the administration site running I concentrated on getting the most tricky Service Apps running first, ie the User Profile and User Sync Service Application. However after a good install with few errors, on editing a user's profile some of the fields had really odd errors saying that "There was a problem retrieving data for this field"

There was nothing obvious; however it turns out that if you don't install the Managed Meta Data Service then you will have this problem. It doesn't matter if you install the MMD before are after the UPA but it just needs to be there.

The order I attempted to install Services after the binary and install of the administration site is as follows:

  • Register some pre-configured AD accounts into SharePoints' Managed Accounts (having setup the right AD permissions first). These will be used for the IIS Application Pools so you know what is running what. SharePoint very unhelpfully gives these GUIDS as names.
  • Create a New Web Application for the MySite Profiles with its own application pool and use one of the Managed Users we setup above

  • Create New Site collection in that Web Application – using a template of Enterprise –> My Site Host
    (Don't try to load site at this time)

  • Create a new User Profile Service Application with its own app pool
    • Start the UPA service – (very easy to miss this)
  • After service has started do an IIS Reset – or even reboot to make sure
  • Start the User Profile Sync service – prompts for details – wait 10 minutes until started
  • Reboot again – very important.
  • Add a Synchronization Connection to AD (You can add LDAP Filters to the connection after it is setup)
  • Start profile Synchronisation (full)
  • Once complete (and it will take a while…..) Manage User Profiles and you will see on some of the fields the errors I mentioned above.
  • Now install the Managed MetaData Service
  • IISReset or reboot again – and these field errors disappear!!

Glad it's so intuitive……..!
References :
Spencer Harbar's Rational Guide to implementing SharePoint Server 2010 User Profile Synchronization
SharePoint 2010 – Provisioning User Profile Synchronization

MSDN: Edit Profile Synchronization connection filters

http://blogs.msdn.com/brporter/archive/2010/02/20/excluding-disabled-user-accounts-in-sharepoint-2010.aspx
http://www.wictorwilen.se/Post/SharePoint-2010-user-profile-properties-temporarily-disabled.aspx

Monday, May 17, 2010

Visual Studio error 'Cannot find the certificate and private key for decryption'

I have a perfectly good (and expensive) Thwate Code Signing Certificate - but when I try to import it into Visual Studio to sign an assembly I get a daft error of the form of the title above. I thought MS might have fixed this in VS2010 but no.

The problem appears to be that the certificate holds too much information for VS to comprehend, so you need to import the Certificate onto your machine and export it without all this extra "stuff".

The solution is to run CertMgr.msc - import your certificate - (usually into Personal->Certificates) and then:
export it by right clicking on the certificate you just imported ->All Tasks ->Export->Yes Export Private Key->
(Do not include any Personal Information Exchange check boxes)
Type a password and export it to a folder (preferably in your VS Project)

Now, in Visual Studio->Signing->Strong Name Key File-> try and browse to your new key and it should load after you enter the password.

Tuesday, May 11, 2010

Sharepoint 2010 BCS connection getting started and authentication issues

There is a very good "get you started" article here, walking you through creating a SharePoint List to an external SQL table. Whilst all the steps were clear it did not deal with security and authentication to the SQL server.

Several methods are available to connect through to back end data providers, however "Connect with User's Identity" (or Pass Through) will only work with Kerberos enabled, and if it is not you will get a Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON' error.

With SP2010 it is much better to use either the Impersonate Windows (or Custom) Identity - which makes use of the SharePoint 2010 Secure Store Service.

If however you dont want to use these or havnt set them up then you can use RevertToSelf which uses the BCS's application pool credentials.

Microsoft warn against this method as a potential security risk and if you try to select it as a connection property it will give you an error saying that revert has to be enabled for the application pool. (See this link)

This is done by setting RevertToSelfAllowed for the BCS model's authentication mode wont work without using powershell to set the Sharepoint Server setting for this to True.

$apps = Get-SPServiceApplication
$bcs = Get-SPServiceApplication where {$_ -match ""}

## If you’re doing this by hand, just type $apps and look #for the Business Data one, then index into it like $apps[i].#If you’re doing it for automation, filter by #$_.GetType.FullName (not $_.TypeName, which is localized).

$bcs.RevertToSelfAllowed = $true

Remember that if you do use this method then the BCS's application pool credentials must have the appropriate rights to the SQL Server Table.

References:
Authenticating to Your External System - BCS Team blog
BCS and External List Learning – Part1
BCS and External List Learning – Part2
Getting started with Business Connectivity Services (BCS) in SharePoint 2010

Sunday, May 09, 2010

SharePoint 2010 and Project 2010 Server demo and Eval VM (RTM edition)

Having spent a week fighting with SharePoint 2010RTM to setup demo scenarios, it is refreshing to see that Microsoft have released RTM VM machines for both SharePoint and Project server. Downloading now and will see what goodies they hold...

Chris Johnson : SharePoint 2010 Demo and Eval VM (RTM edition): "SharePoint 2010 Demo and Eval VM (RTM edition)"

Friday, March 26, 2010

Running VMware vSphere Client on Windows 7

The problems running vSphere clients on Windows 7 have brought a lot of pain and the proposed workarounds were complex and invariably didnt work.

BUT here is a very good simple arcticle which works ! - we like this a lot...

Wednesday, March 24, 2010

Sharepoint 2007 wildcard searching

To use a wildcard search or part of the name, you must specify the field name you are looking for.

eg. FileName:whiz* will find all documents with a FileName starting with "whiz"

I havent found a way to search on field's with spaces in yet (ie where there is a space in the file name replacing it with _x0020_)

There is a good article here
http://www.novolocus.com/2009/05/27/sharepoint-can-have-wildcard-searching/

Thursday, February 25, 2010

dotNet Dictionary - ContainsKey

I think Dictionary objects are brilliant data structures. The way they can contain objects and nested dictionaries within them seleves makes them a fantasic store,

However I was using a Dictionary obect to store Key Value Pairs and I couldnt be sure that I knew if all the key's were present. The first way I found to check was to try to get the key within a Try Catch block and if they key wasnt found the Catch block would return a default value.

This was both stressfull to me and the performance of the app, so I was very pleased when I found a method to test if a key existed: Dictionary<(Of <(TKey, TValue>)>)..::.ContainsKey Method

BUT I was even happier when I found the Dictionary<(Of <(TKey, TValue>)>)..::.TryGetValue Method

TryGetValue means you dont need to wrap your code in Try Catch blocks to handle exceptions and you can pass back a default value if the key is not found. Brilliant !

A couple of Excel VBA usefull notes

UserName = Environ("Username")
Domain = Environ("UserDomain")
Combined= Environ("UserDomain") & "\" & Environ("Username")

CurrentDate = Date
CurrentTime = Time

Some file and folder VBA commands

Current folder name: CurDir
Change the active folder: ChDir "C:\My Documents"

File exists test: If Dir("F:\My Documents\My Workbook.xls") <> "" Then ....

Delete a file : Kill "F:\My Documents\My Workbook.xls"

Creates a new folder: MkDir "F:\My Documents\NewPrivateFolder"
Delete a folder: RmDir


Copy a file (the file must be closed): FileCopy "OrgWorkBook.xls", "CopyWorkBook.xls"

How to move a file (the file must be closed):

OldFilePath = "C:\OldFolder\Filename.xls" ' original file location
NewFilePath = "C:\NewFolder\Filename.xls" ' new file location
Name OldFilePath As NewFilePath ' move the file


My thanks to this reference - allbeit a little hard to read beacause of the ad's

February 2010 Windows Media Center Cumulative Update for Windows 7

Although Windows 7 Media Centre is much better than previous releases - its support of media extenders such as Xbox 360 and Linksys are woefully behind. Here is the latest patch for Windows 7 and I do hope that this is supported by the extenders being updated as well.

Sharepoint list item - custom drop down menu

To be able to customise Sharepoint Context menus easily using Javascript in a a Content Editor Web Part is extreemly powerfull and remarkably simple to get working. - see this article for guidance Customizing SharePoint Context Menus.

(Suplimental: The obove article is ok as far as it goes however to try to get the client side menu to carry out actions is not simple. You need to be skilled in Javascript and have a knowledge of the internal variable names Sharepoint 2007 users. [at least Sharepoint 2010 will have a client side dll!).

Other references I found usefull were :

Wednesday, January 27, 2010

BUG: SSIS 2008 derived columns from User variables data type

I wanted to create a derived column from a user:variable in SSIS so that I could combine the input of a CSV into a SQL table along with a column name saying where the CSV came from.

Usually you initialise the user:variable before the package starts with a non relevant string, such as "1234" then updated it to the correct value once the process starts.

The problem is that when you use the Derived Coulmn Transformation Editor and add a Derived Column as SSIS fills in the Data Type automatically for you and wont let you change its data length. So if you initialise the user:variable with "1234" the new column will be defined with a Data type Unicode string [DT_WSTR] 4 - notice maximum length of 4!

So if you update the user:variable string to a length of 5 characters SSIS fails!

My work around is to make sure that you initialise the user:variable string with a value which has a length of the maximum possible string which you are likely to encouter.

Hopefully this will be resolved in future releases.

Tuesday, January 26, 2010

Another Microsoft SQL exam passed

I'm sure it gets harder to study and pass exams as each year goes by, however just managed to achieve 98% in Microsoft SQL Server 2008, Implimentation and Maintenance so off for a beer to celebrate.

Summing Excel Range Intersects

Ever wanted to add up the value of the Intersecting Sets or Ranges.

I had a couple of Ranges as rowns,
eg Dept1 = Rows A1:N4 , Dept2 = Rows (A5:N6, A12:N16) etc

and then Columns Ranges for Jan, Feb
eg Jan = Column B1:B12, Feb = C1:C12 etc.

I wanted to get the sum of the Intersection between Ranges Dept1 for Jan. To do this use a Space as an operator. eg =Sum(Dept1 Jan)

Whilist everyone knows about the comma as a Union operator not many people have heard of space as an Intersect operator - see "Reference operators" in Excel help for more info

Tuesday, January 19, 2010

Using Windows 7 for "Server-like" loads

I'm studying for a SQL 2008 exam and found that you can mirror up to 3 backups to different devices, so when a client had some new Windows 7 machines delivered with loads of spare hard drive, I thought this would be an excellent location to backup an additioanal copy of SQL to overnight.

However after about a 15Gb backup from SQL 2005 server onto a Windows 7 share, the Windows 7 workstation seemed to loose its visibility from any of the Windows 2003 servers. (The other Windows 7 machines could still see the share).

A reboot solved the issue, until I tried to backup again!

Looking in the event log, I found memory errors showing as Non-Paged pool problems.

After a lot of searching, I came across the article below - it would appear that from the old SysInternals Site there used to be an article called "Tunining Workstations for Server-Like Loads". Microsoft seem to have "tidied up" these old articles and I couldnt find any links to the references shown on Technet, however if you make the registry changes to a Windows 7 machine, it seems a lot happier pretending to be a backup file server overnight.

Set the following registry to key to 1

HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\LargeSystemCache

and set the following registry key to ‘3′:

HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters\Size

Reboot and enjoy!


References:
http://alan.lamielle.net/2009/09/03/windows-7-nonpaged-pool-srv-error-2017
Event ID 2017 and 2021 - microsoft.public.windows.vista.networking_sharing Google Groups

Tuesday, January 12, 2010

Tuesday, December 15, 2009

Configuring User Profiles in Sharepoint 2010 beta 2 in the enterprise

This gives an interesting walkthrough for configuring user profiles. (Despite 5 installs of a Sharepoint 2010 its still not quite right).

Ive found this is a very tricky and time consuming process fraught with problems and Kathy's notes are very helpful.

in reference to: Kathy Hughes, MVP (view on Google Sidewiki)