Setting up the rig, or rigging the setup? ;-)

So today, I got a present for my company. 24 GB or RAM. My Testlab is complete now. After it failed to perform as a testlab before (it was basically designed as an overpowered dev desktop) I upgraded to some flashy RAM and now I can run me some virtuals with Hyper-V.

Setup is such:

Host – DNS, DC, Hyper-V

Scripted SharePoint Environment (via AutoSPInstaller) with 1 DB (just for show with 2 GB of RAM), 2 WFE and 2 App Servers.

The idea is to have a small farm setup in less than a day (half a day actually).

It’s a long running project, but now I need to get it done…

Leave a Comment

DisableLoopBackCheck Alternative (for Production)

So, true story…
I have been working in a global company and there are three environments (test, pre and prod). Test- and Pre-environments had disableloopbackcheck enabled – Production didn’t. Now in Production there was an error whenever a SharePoint WebPart, Custom Code or Workflow Solution (i.e. Nintex) was trying to call a web service hosted on the farm. There is basically only one WFE, so whenever they were calling they were calling the WFE they were calling from, i.e. service caller == service provider. Classic DisableLoopBackCheck Scenario.

You can verify this by checking the IIS Logs. (Go to IIS, select the site that you want to inspect and click ‘IIS\logging’. There you will find the physical path of the logs:
Default: ‘%SystemDrive%\inetpub\logs\LogFiles’

Go to that location and check out you will find some folders there…
The naming convention here is: W3SVC{ID of IIS Site}. So on my test machine I see:
W3SVC857252282
W3SVC1408403042

That’s because I have two started IIS sites apart from the web services site (that’s 80 default and CA).
Now you want to know which folder to check, not why these folders are there, but give me one more step.
The ID of the web site in IIS you can get from the advanced settings.

Go to IIS and go to the context menu of the IIS Site you are interested in (right-click). Then do manage site > advanced settings
The ID will be displayed in the corresponding value field for the ID key.
In my case (80 -Default) this is 1408403042. So I check out that folder and voila I have logs for this site. Now I sort those descending order by date. What I can see is something like this:


2011-12-23 07:56:13 fe80::4519:cfda:26df:cf90%11 GET /_vti_bin/spscrawl.asmx - 80 - fe80::4519:cfda:26df:cf90%11 Mozilla/4.0+(compatible;+MSIE+4.01;+Windows+NT;+MS+Search+6.0+Robot) 401 1 2148074254 3

or

2011-12-23 07:56:13 fe80::4519:cfda:26df:cf90%11 GET /_vti_bin/spscrawl.asmx - 80 WORKGROUP\WIN-DGKR68KV601$ fe80::4519:cfda:26df:cf90%11 Mozilla/4.0+(compatible;+MSIE+4.01;+Windows+NT;+MS+Search+6.0+Robot) 200 0 0 6

What that means is the service (asmx) file on port 80 was hit, and there has been an unauthorized exception (401.1). The second one shows a success (200) and it shows the name of the server called. So if you are working with a multi-server environment this helps to figure out who is calling whom.

Check the google for more explanation on this.

Back to the actual problem I was trying to solve…DisableLoopBackCheck.

First check this link so you understand what the issue is. Spencer is an authority on SharePoint. When I think for myself I do have to agree though. If MS intends you not to do this, then don’t.

Thanks to this you have an alternative.

All I am going to do is give screenshots below, tell you it worked for me and tell you one thing to watch out for:

Being the idiot I am, I first added the urls instead of the host names to the registry. That’s crap of course and doesn’t work.
SO DO NOT ADD HTTPS://something.domain.extension but rather ONLY something.domain.extension.

This definitely has to correspond with your DNS Setup (A-Record/ C-Name). Don’t forget to add the hosts in the hosts file as well.
The registry change didn’t even need an IISReset /noforce. The host name file did.

This is where you find the disableloopbackcheck (if it’s been configured, if not it’s not there to begin with) in the registry:
HKEY_LOCAL_MACHINE > SYSTEM > CurrentControlSet > Control > Lsa


DisableLoopBackCheck

This is where to go for the BackConnectionHostNames (MultiStringValue, needs to be created)
HKEY_LOCAL_MACHINE > SYSTEM > CurrentControlSet > Control > Lsa > MSV1_0 > “BackConnectionHostNames”

backconnectionhostnames

This is where to go for the hosts file: ‘%SystemDrive%\Windows\System32\drivers\etc\hosts’

hostnamefile

Leave a Comment

Setting Value of UserProfile Property on all users

If you want to change a setting for all user profiles of a user profile service application, e.g. Newsgator Digest Email (“NGReceiveDigestEmail”) this is what you can do:


if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null)
{
Add-PSSnapin "Microsoft.SharePoint.PowerShell"
}

# Create Service Context
$site = Get-SPSite http(s)://mysite-host.extension
$serviceContext = Get-SPServiceContext $site

# Get ProfileManager, User Profiles and User Properties
$profileManager = New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager($serviceContext)

$userProfiles = $profileManager.GetEnumerator()

$val = "false"

foreach($userProfile in $userProfiles)
{
# Set New Value
$userProfile["BoolValueNameOfProperty"].Value = $val
$userProfile.Commit()
}

#Dispose of site object
$site.Dispose()

The script first gets the SharePoint snap-in silently.

Then itgets the User Profile Manager, which needs to the mysite-host location as a context (don’t forget to dispose the site object in the end, and in production watch out for exceptions that may lead to not executing that line of code).

The enumerator of the profile manager allows iteration of all user profiles. Set the value for the boolean property (for strings or other value types the assignment will look different).

Commit the change and dispose after iteration is finished.

Leave a Comment

Dateianzeige des GAC im Windows Explorer / FileView of GAC in Windows Explorer [DisableCacheViewer]

This is basically the English Version of this German article on msdn: http://msdn.microsoft.com/de-de/library/bb979071.aspx by Mathias Schiffer.

It tells you how to disable the cache viewing of the global assembly cache and this way lets you view the gac the same way you can browse the rest of the file system. This is good for finding dlls that are in possession of running processes and therefore cannot be removed from the gac.


This short article shows a little tweek that allows you to browse the Global Assembly Cache (GAC) of the .NET Frameworks in Windows Explorer like a usual folder. You thereby get a look at the physical struktur of the GAC.

Browse the Global Assembly Cache (GAC) of the .NET Frameworks in Windows Explorer (it can be found in the windows sub-directory “assembly”, i.e. typically “c:\windows\assembly“). This is how Windows Explorer shows the GAC as a list (default).

The so-called “GAC-Viewer” allows you to get a good quick overview of names, types, version numbers and details of the assemblies in the GAC.

GAC

Image 1: GAC-View in Windows Explorer

This does not have a lot to do with the reality of what the directory “assembly” contains in terms of files and folders.

To get a better look at the real structure of the GAC, you can deactivate the GAC-Viewer. Every time when the GAC is viewed via Windows Explorer the value of a registry key in the registry branch HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fusion, the value of the DWORD-Entry DisableCacheViewer is checked. Usually this value does not exist and this means it has a value of 0. If you create a new DWORD-Entry DisableCacheViewer in the branch with the value of 1 the GAC will not use the cacheview and therefore show you everything at once.

registry

Image 2: GAC de-mystified – this is how you do it!

TRight away you will see that the GAC actually resides in a sub-directory \assembly\GAC\. For every registered assembly there is a sub-directory with the name of the assembly. This itself contains in-turn sub-directories, that contain version number and public key of the assembly in their name. These sub-directories contain the actual assembly-file and a windows initialisationfile (INI).

To get the GAC-Viewer back to normal, all you need to do is either set the value of the DWORD DisableCacheViewer to 0 or delete it altogether.

If you want to switch between views it might be helpful to have two REG-Files which you can create with the Windows Editor and save accordingly:

Windows Registry Editor Version 5.00
// Deactivate the GAC-Viewer for Windows Explorer
// Save this as text-file with the name GacViewOff.reg

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fusion]
“DisableCacheViewer”=dword:00000001

Listing 1: Template for a REF-File for turning off the GAC-Viewer

Windows Registry Editor Version 5.00
// Activating the GAC-Viewer for Windows Explorer (Default)
// Save this as text-file with the name GacViewOn.reg

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fusion]
“DisableCacheViewer”=dword:00000000

Listing 2: Template for a REG-File for turning on the GAC-Viewer

Leave a Comment

SharePoint Farm Version

So I found two sites and combined them to get what I needed:

http://microsoftepmsolution.blogspot.com/2011/10/epmsharepoint-2010-how-to-display-farm.html

This is how to get the version of the farm via powershell:
Get-SPFarm | Select -ExpandProperty BuildVersion

Farm Versions via Powershell

This is how you find out the corresponding CU/ Service Pack for the build version:

http://www.toddklindt.com/blog/Lists/Posts/Post.aspx?ID=224

Thanks to Todd on this one.

Leave a Comment

Windows Server 2008 and Snipping Tool

So I am always confused where I can find my snipping tool. One of my most beloved tools especially on my demo and test machines. So here it is:

activate ‘desktop experience’ feature

reboot.

check c:\windows\system32\SnippingTool.exe

Leave a Comment

Extend SharePoint 2010 Web Application Http to Https

So a client of mine wants to use https on production and they have been running http until now. So this production environment has lots of data on it and they don’t want to lose that. Now different information is flowing around that you lose data when you migrate from http to https. Now I was asked to get this move done and of course my due-dilligence requires me to do this once on my demo machine before I dive into the quirks of the company.

Now I thought about three possible ways of doing this:
1) Create IIS AppPool and Site with SSL and unextend the web application in Central Admin and extend it with the newly created IIS Site.
2) Just extend the web application and set require SSL connection in the IIS Site.
3) Add another binding in IIS and add alternative access mapping in CA.

So I read somewhere that 2 and 3 are pretty much the same, MS does recommend the extension of the web app though. I am never sure what happens under the hood, but what I can say is I tried 2 and 3 and both do not cause loss of data. Now possibly the web config is altered (set back to default) or I have to redeploy the solutions, but in the end that’s nothing compared to the cost of losing business data.

Now there is the discussion of how to do this, because there are a few things to keep in mind:
1) IP-Ranges are not IP-Universes (ranges are finite!)
2) Get your certificates in place and hopefully it’s not just a server certificate in an enterprise environment (loadbalancing, anyone?)
3) Don’t forget your DNS-Routing!

So for my client I will try to get the dns routing corrected, the certificates in place and then extend the web-application.

Here some useful screenshots:
Edit bindings


Extend


Require SSL


Server Certificates


SSL Settings

Leave a Comment

SharePoint 2010 Record Center – available ListTemplates (SPWeb.ListTemplates)

So I needed the Record Library ListTemplateId for querying. This is how I found out. Reason for posting is not that you couldn’t figure it out by yourself – it’s not that hard, but having the ListTemplates available quickly (primarily for myself ;-) ).

List sortedTypes = new List();
foreach (SPListTemplate current in web.ListTemplates)
{
    sortedTypes.Add(current);
}
sortedTypes.Sort((x, y) => string.Compare(x.ToString(), y.ToString()));
Name Type_Client Type
Survey 102 Survey
Asset Library 851 851
No Code Workflows 117 NoCodeWorkflows
Custom List 100 GenericList
Custom List in Datasheet View 120 CustomGrid
External List 600 ExternalList
Custom Workflow Process 118 WorkflowProcess
Data Sources 110 DataSources
No Code Public Workflows 122 NoCodePublic
Workflow History 140 WorkflowHistory
Pages Library 850 850
Slide Library 2100 2100
Issue Tracking 1100 IssueTracking
Wiki Page Library 119 WebPageLibrary
Picture Library 109 PictureLibrary
Links 103 Links
Record Library 1302 1302
Document Library 101 DocumentLibrary
Form Library 115 XMLForm
Discussion Board 108 DiscussionBoard
Tasks 107 Tasks
Project Tasks 150 GanttTasks
Announcements 104 Announcements
Contacts 105 Contacts
Calendar 106 Events

Leave a Comment

SharePoint 2010 Environments Setup

Inspired by Chris Johnson from a year back (SharePoint development environments, my guidance) I will share my experience for the solution deployment life-cycle.

As consultant, I need mobility, so

  • I prefer working on a laptop with 8GB and a dual-core with at least 2,20 GHz
  • If I have a customer image, it is hopefully Windows 7 x64 or comparable
  • I preferrably virtualize my dev environment (preference: vm-player)
  • My preferred environment is a Windows Server R2 Image with SharePoint 2010, Office 2010, Designer, Adobe Reader, Adobe IFilter, Visual Studio 2010

For any work related to the User-Profile-Service or other Domain-Centric development, I need to have a Domain Controller on that machine first. I included that on my newer images.

The customer typically has multiple environments.

For compliance and separation of concern reasons I prefer the test, pre-live and production environment setup. Test and Pre-Live should be virtualized from a cost perspective, production should be a multi-farm environment, dedicated machines, if possible, no shared-sql (actually: SN – shared-nothing). The biggest reasons are scaleability when storing large files in RBS mode and Reporting Services, that should not be on a shared environment, as well as licensing considerations.

If the customer is a global player, a multi-farm-setup should be used. Architecture of multi-farms (Technet Article about this, if you have the money and the need, 3-5 farms with distinct usage can make sense (Services, Collaboration (Light-Weight Sites), Special Use/ High Load Applications, User Profile Services, Custom Services), in some scenarios even more)

Depending on the capabilities and resources in the Infrastructure Department within IT, it can be good sense to have the following mapping for purpose of each environment:

Environment Purpose Notes
Virtual Dev Environment Develop Code, Unit Testing virtual
(Virtual Integration Environment) (Integration Testing) Not absolutely necessary, virtual
Testing System Test/ Integration Testing virtual, same patch path as production, same solutions as production, same web applications and site collections as production
Pre-Live User Acceptancy Testing virtual, same patch path as production, same solutions as production, same web applications and site collections as production, once signed-off by IT-Project-Management, a solution that is in testing, may be deployed here
Production Live Application, only bothered by System and Application Updates, Data Migration preferrably native, once signed-off by Business-Project-Management, a solution that is in pre-production may be deployed here

Leave a Comment

Tweet

In a tweet type of blog post I just wanted to mention the topics flying around my way at the moment:
- OpenSuse – on a virtual machine
- Xampp – on the OpenSuse
- WordPress – the downloadable software, for testing
- Tweetdeck – client software for combining all your information (rss, twitter, facebook)
- Alfresco (open source alternative to sharepoint?)
- Windows Server R2 (with different server roles, e.g. Web Server, Domain Controller, Datacenter)
- Laptops: Lenovo vs. Dell
- Promise Pegasus Storage
- Drobo and Airport Extreme – Whatever happened to DroboShare?

Leave a Comment

Older Posts »
Follow

Get every new post delivered to your Inbox.