Windows Server: allow multiple RDP sessions per user


October 2, 2014 - 11:56, by Steven Van de Craen - 0 Comments

I’ve often worked on SharePoint environments where I accidentally got kicked or kicked others because we were working with the same account on the same server via Remote Desktop. By default each user is restricted to a single session but there’s a group policy to change this.

In Windows Server 2008 you had a UI for this, but since Windows Server 2012 you have to do this via gpedit.msc. This basically enforces a setting in the Windows Registry which you could do directly:

  • Open Registry Editor (Start > Run > regedit)
  • Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server
  • Ensure the DWORD fSingleSessionPerUser exists and is set to 0

 

Or -even easier- create and run a .reg file with the following content:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server]
"fSingleSessionPerUser"=dword:00000000

 

Here’s a quick link for you: ALLOW_MULTI_RDP_PER_USER.reg

HTH


SharePoint Saturday Belgium 2014 - Content Enrichment in SharePoint Search


April 28, 2014 - 15:06, by Steven Van de Craen - 0 Comments

Last Saturday I delivered a session on “Content Enrichment in SharePoint Search” on the Belgian SharePoint Saturday 2014, showing how to configure it, its potential and some development tips and tricks. Although it was a very specific and narrow topic there was a big audience for it. We even had to bring in extra chairs to have everyone seated.

If you missed my session (shame on you!) or you want to read up on it again, below is my deck and demo code.

Slides

SPSBE 2014 Content Enrichment in SharePoint Search

 

Code

The demos showed the basic configuration, how to use WCF Routing to overcome the biggest limitation, how to debug using Fiddler by configuring the proxy, how to debug by attaching to the noderunner process, etc. The final demo would extract bank account numbers from indexed documents and store them in dedicated Managed Properties to increase findability when searching on one of these numbers.

» SPSBE2014.ContentEnrichmentInSearch.zip

Disclaimer: you’re free to use this code as you desire, but I’m not taking responsibility should it blow up your server or make babies cry.

 

Community Red heart

I think we can all agree that SPSBE2014 was a huge success. A big applause for the organisers, the speakers and the attendees for making it all happen. It goes to show that the our SharePoint Community is really great, so show them some love on http://www.biwug.be or http://twitter.com/biwug.


SharePoint and PowerShell remoting


February 28, 2014 - 13:30, by Steven Van de Craen - 2 Comments

In my current project I’m dabbling with PowerShell to query different servers and information from different SharePoint 2010 farms in the organization. This blog contains a brief overview of the steps I took in order to get a working configuration.

Enable remoting and credential pass-through

You need to enable remoting and also credential pass-through. The latter is important because your SharePoint statements will need to authenticate to the SQL Server containing your SharePoint databases, or all your statements will fail with an access denied.

Enable-PSRemoting

I did this on both the “client” and the “server”, because my client can actually be queried itself as well…

Enable-WSManCredSSP -Role Client –DelegateComputer MYSERVER01

I ran this on the “client”.

Enable-WSManCredSSP –Role Server

I ran this on the “server”.

CredSSP allows the credentials to pass-through (double hop) . There’s a security note in the TechNet article;

Caution: CredSSP authentication delegates the user's credentials from the local computer to a remote computer. This practice increases the security risk of the remote operation. If the remote computer is compromised, when credentials are passed to it, the credentials can be used to control the network session.

» Enable-PSRemoting: http://technet.microsoft.com/en-us/library/hh849694.aspx

» Enable-WSManCredSSP: http://technet.microsoft.com/en-us/library/hh849872.aspx

Force PSVersion 2.0

If you have multiple versions of PowerShell then most likely new instances will be using the latest version. There is a common issue regarding SharePoint 2010 Management Shell and PowerShell 3.0 (or above) outlined here: http://support.microsoft.com/kb/2796733.

Microsoft SharePoint is not supported with version 4.0.30319.17929 of the Microsoft .Net Runtime.

If you’re seeing this issue when remoting you can create a new PSSessionConfiguration on the “server” and have “clients” reference it.

Register-PSSessionConfiguration -Name PS2 -PSVersion 2.0

I ran this on the “server” in a PowerShell 3.0 prompt.

» Register-PSSessionConfiguration: http://technet.microsoft.com/en-us/library/hh847899.aspx

Invoke-Command / Enter-PSSession

There’s but one thing that remains, and that is to see if it worked. Make sure to specify CredSSP and the reference to the PSSessionConfiguration object.

Invoke-Command -ComputerName MYSERVER01 -ConfigurationName PS2 -Authentication CredSSP –Credential MYDOMAIN\myuser -ScriptBlock { asnp Microsoft.SharePoint.PowerShell; Get-SPFarm }

» Invoke-Command: http://technet.microsoft.com/en-us/library/hh849719.aspx

» Enter-PSSession: http://technet.microsoft.com/en-us/library/hh849707.aspx

 

Happy remoting!


Hyper-V and NAT


January 16, 2014 - 07:13, by Steven Van de Craen - 1 Comments

Networking “challenges”

I like Hyper-V. I really like it. But I’m not blind for shortcomings either. The biggest frustration for me has always been the lack of NAT. Up until now I was using ICS (Internet Connection Sharing) but this was far from perfect;

» It used the same IP address range as the Windows Phone “Internet Sharing” feature. So when I want to tether I had to disable ICS and thus lose connectivity inside my VMs. Really annoying when you need to have both.

» Sometimes I’m connected through an Ethernet cable, other times via WiFi. Having to switch the ICS to a different adapter requires quite some clicks. I semi-automated this with PowerShell, but it wasn’t perfect.

» You can’t establish a Cisco AnyConnect VPN connection when ICS is enabled. You can enable it after the connection is established, but still.

» ICS seems less loved in Windows 8 and Windows 8.1. I often had no connectivity until I disabled ICS on my adapters, even though I wasn’t actively using it at the time.

But if you want your VM to have internet connectivity without putting it directly on your network (avoid machine name conflicts, avoid people accidentally connecting to “your” VM instead of theirs, …) there’s little choice, until now.

A perfect match

Ironically, the solution lies with a competitive product; VMWare’s NAT Service. When you install VMWare’s virtualisation product (like Player), it installs a Windows service and creates a network adapter that has NAT capability. You can then connect your Hyper-V Virtual Switch to the VMnet8 adapter and you’re all done!

I accidentally stumbled upon this “solution” when it was mentioned by Thomas Vochten on Twitter.

He was kind enough to write it up into a blog post; http://thomasvochten.com/archive/2014/01/hyper-v-nat

It immediately solved all of my issues with ICS and took away my biggest frustration with Hyper-V Smile

Hope it helps you too!


Look at me


October 11, 2013 - 16:12, by Steven Van de Craen - 0 Comments

Hey you, look at me! I’m a blog. A SharePoint blog would you believe it? Don’t I look fancy?

A new design

For the last few weeks the incredible Tom Van Bortel has been working on a new blog design for this blog. A task I wouldn’t dare to commit myself to, I have very little design skills. But he does!

The result is a modern look, clean and slick, and hey it’s even responsive! Go ahead and play with that browser window and make it smaller and wider Winking smile Very nifty feature thanks to Bootstrap.

If you’re interested in the very details on how the design was formed just drop me a line and perhaps I’ll ask Tom to do a guest post. Or ask him yourself directly, his coordinates should be on his own blog.

SharePoint or CKS:EBE ?

My blog is indeed hosted on SharePoint, but it really still is CKS:EBE that does most of the rendering using the MTF (Modular Theme Framework). Actually I couldn’t upgrade the blog to native SharePoint 2013 mode because of the CKS:EBE customizations, so it is running in SharePoint 2010 mode on our SharePoint 2013 farm. One day I’ll have to upgrade to SharePoint vNext since I doubt they’ll support both 2010 and 2013 modes.

» More posts on CKS:EBE

Content transformation

In order for the images to be ‘responsive’, I had to add a CSS class “img-responsive” to all images in all posts. The blog posts were SharePoint List Items, so this should be an easy enough task to automate via PowerShell or .NET code. I’m still more fluent in .NET than PowerShell so I wrote up a quick application to transform all existing blog posts to have responsive images.

You can go different approaches here, but I chose the Html Agility Pack so I could manipulate the HTML as a queryable, adaptable HtmlDocument. This is very similar to the System.Xml.XmlDocument and it’s very “tolerant” when it comes to malformed HTML.

Here’s the quick and dirty code from my transformation script. I didn’t focus on writing clean code here, it’s just a one off.

using HtmlAgilityPack;
...

public static void Run()
{
    string url = "http://www.sharepointblogs.be/blogs/vandest/lists/posts";
    using (SPSite site = new SPSite(url))
    {
        using (SPWeb web = site.OpenWeb())
        {
            SPList list = web.GetList(url);

            foreach (SPListItem item in list.Items)
            {
                string oldBody = (String)item["Body"];
                string newBody = ModifyHtml(oldBody);

                item["Body"] = newBody;
                item.SystemUpdate();
            }
        }
        SWF.MessageBox.Show("Done");
    }
}

public static string ModifyHtml(string inHtml)
{
    string result = null;

    HtmlDocument doc = new HtmlDocument();
    doc.LoadHtml(inHtml);

    foreach (HtmlNodeNavigator imgNodeNav in doc.CreateNavigator().Select("//img"))
    {
        HtmlNode imgNode = imgNodeNav.CurrentNode;
        HtmlAttribute classAttr = imgNode.Attributes["class"];

        if (classAttr == null)
        {
            imgNode.Attributes.Add("class", "img-responsive");
        }
        else
        {
            string classAttrValue = classAttr.Value.Replace("img-responsive", String.Empty).Replace("  ", " ").Trim();
            classAttrValue = String.Concat(classAttrValue, " img-responsive").Trim();

            classAttr.Value = classAttrValue;
        }
    }

    using (StringWriter sw = new StringWriter())
    {
        doc.Save(sw);
        result = sw.ToString();
    }

    return result;
}

Writing posts

I’m still a loyal user of Windows Live Writer for writing my posts. I like the Edit/Preview/Source modes, the WYSIWYG style of writing up a blog post, and also the plug-ins. For now I’m using Insert Code for code snippets and Dynamic Template. The latter is really cool since you can create your own snippets using HTML, JavaScript and ASP.NET and offers a lot of potential. The author has put up some basic tutorial videos that might interest you and will get you started.

So now it’s up to me again to start blogging more frequently. No more excuses now Winking smile


Convert Hyper-V 3.0 machine to VMWare Workstation


December 5, 2012 - 13:41, by Steven Van de Craen - 1 Comments

There is a lot of ink already on the subject of converting Microsoft Virtual Machines to VMWare Virtual Machines, but I’m writing down what worked for me to get it up and running.

VMWare vCenter Converter

Download it and install it. If you’re not carrying multiple machines then install it on your Windows 8 (that’s running your Hyper-V machines). I’m doing that, because a different machine adds quite some hassle when trying to connect.

image

Run as Administrator

Configure the Converter client to Run As Administrator.

image

Connect to IP address

When connecting to the Hyper-V server, you might want to use the IP address of the machine (eg. 127.0.0.1) to avoid some hassle with SMB restrictions. I’m sure you could as well solve those, but IP works fine as well.

image

Unable to obtain hardware information for the selected machine

If you get this, and believe me you will, first make sure the selected machine is powered off. But even then you’ll likely run into this. The fix is pretty nasty:

Grant “Everyone” Modify permissions on the folder containing the VM disks (.vhd).

image

Another thing to verify is that your Virtual Machine hard disk is not using the newer VHDX format introduced in Windows 8 and Windows Server 2012. This will also result in the above error.

You'll need to edit and convert your disk to the VHD format. If you have snapshots and want to keep them, you can export the snapshot and import it again as single VHDX file, which can then be converted...

UNC path

When you get to this screen, make sure the path to store the converted machine on is a UNC path.

image

Easiest here is to create a temporary folder and grant the specified account Write permissions.

Finally

When you pass all these hurdles you’ll get to a few more configuration screens like the one below, but really nothing will stop you now from converting that machine, let alone insufficient disk space ;)

image

So why am I converting you ask ? No, I’ve not yet given up on Hyper-V. Sure it has less features but so far I haven’t really missed any of them. I can get around using Remote Desktop and Internet Connection Sharing just fine. I’m only creating these VMWare images for some of my colleagues that run VMWare (either they can’t be convinced or don’t have the right CPU to run Hyper-V 3.0 on Windows 8).

Reference

Another really useful guide on this is the following blog post: Converting Hyper-V to VMWare


SharePoint Conference 2012 Report - Mental Overload


November 14, 2012 - 22:17, by Steven Van de Craen - 1 Comments

SharePoint Conference 2012 really is a mental overload. Just the scale of the Conference itself is enormous (me being a first time SPC attendee), let alone the impressions that Las Vegas adds to that.

The keynote was the marketing machine at its best. I don’t mean that as a bad thing. It was really well-prepared and got everyone excited about the product and conference.

WP_000145WP_000147

Then there are all those sessions for developers, IT professionals and business. There are so many sessions that overlap that you have to make some hard choices. Luckily most of the sessions are recorded and made available afterwards.

Yesterday was the big outdoor event on Mandalay Beach with Jon Bon Jovi and the Suburban Kings performing. Being not much of a fan I didn’t get excited about it, but I went anyway and enjoyed the vibe, catering and conversations with other attendees.

WP_000167WP_000170

The ending fireworks were a real blast Glimlach

WP_000175WP_000182

The meetup with fellow Belgian attendees was real fun. Got to meet new and familiar faces.

Finally, I took both SharePoint 2013 beta exams. They put a real focus on Office 365 which is not my real area of expertise. But I’ll have to wait for a few more weeks to know the result. We’ll see Glimlach

Cheers!


SharePoint Conference 2012 Report - Viva Las Vegas


November 12, 2012 - 15:47, by Steven Van de Craen - 1 Comments

My colleague Dimitri and I got the opportunity to go to this year’s SharePoint Conference (#SPC12) in Las Vegas. I have to admit that I had mixed feelings at the beginning; I’m not much of a traveler to begin with and also leaving my wife and kids didn’t sound too appealing. But of course we’re taking Vegas here, pretty much a once in a lifetime opportunity! So along with the thousands of other attendees, excitement began to grow when the conference got closer and closer.

Brussels – London – Las Vegas

We departed from Brussels Airport yesterday in an Airbus A321 from British Airways, destination London Heathrow. I have taken this trip before on preious occasions, so no suprises there. The trip took about 40 minutes if I recall correctly.

At Heathrow we got our connection to Las Vegas with minimal waiting time. At least it didn’t seem a very long wait to me. Probably the excitement.

DSCF4841

DSCF4843DSCF4857

We flew in a Boeing 747 in economy class. I’m a pretty tall guy and have to admit that I did expect more leg room in a transatlantic flight, but I managed. The entertainment system was a cool bonus for me. I got to see a lot of pretty new movie releases during flight.

I managed to do a few naps along the way. Of course there’s the jet lag that one needs to take into account. My biological clock refuses to let me sleep here in Vegas during night time, this first night. So I’ve been awake since 11PM (local time) and finally decided to get up to write this little report.

By the way: I don’t look my best in this particular picture Knipogende emoticon

Luxor

We’re staying in the Luxor. Didn’t have time to take a lot of pictures because I wanted to settle in first, but the Luxor hotel -and all others- are really amazing. Huge, spectacular and packed with a certain energy and atmosphere that makes up Vegas (I guess).

DSCF4863

I did a bit of late night gambling yesterday, before turning to bed, but had no luck on the slots. They’re not my type of gambling anyway but I was too tired to join in a poker game. Might do that tonight or else another day.

Conference

There are still a few hours to go until the Conference kicks off, and I’ve run out of battery on my laptop, so I’ll leave it to this for now and am going downstairs to see if anything’s happening for the moment.

If you bump into Dimi or me, say hi Glimlach

Until later!

Steven


Windows 8


March 17, 2012 - 10:16, by Steven Van de Craen - 0 Comments

A few days ago I tweeted about having moved to Windows 8 Consumer Preview as main Operating System. So far still really happy with it.

Windows 8

My previous OS was Windows Server 2008 R2 with Hyper-V for virtualizing my SharePoint development environments. I had tweaked Windows Server as much as possible to be more of a desktop OS than server OS, but the fact remained that it just hadn’t optimized audio and video drivers. Surely they’re adequate to perform basic tasks, but there still was a little bit mouse and audio stuttering when a YouTube started playing, let alone playing a recent game such as Modern Warfare 3 or Skyrim. For those I kept a Windows 7 dual boot environment around.

Hyper-V 3.0

The main driver to move to Windows 8 for me was to have Hyper-V. Mind you that it’s not a straightforward path to migrate your Windows Server 2008 R2 images. I tried the export and import feature; it complained about not being able to use Saved State but it kindly asked me if it could delete that, I said yes. The import went fine but still I could start up a snapshot due to some obscure error. Perhaps this is a beta issue and will be fixed in RTM.

I decided to make a copy of the entire VMDISK folder and then just create new Virtual Machines in Windows 8, linking to existing disks (.vhd and .avhd). Nothing new here but note that you can use the “Edit Disk” functionality to merge a snapshot disk with its parent disk.

So I now had “base” images of all my machines in Windows 8 and booted them up. The next thing you’ll probably do is install the new Hyper-V Integration Tools in each virtual machine. This will upgrade the HAL in the VM.

Hyper-V networking has changed in 3.0 as well, using network bridging to overcome some issues from the past. This new Network Adapter will be seen as a new NIC in the VM as well, so you’ll have to reconfigure any static IP’s you had before.

A final thing is Windows Activation. Since you’re using a new HAL in the virtual machines, Windows will need to reactivate.

After that you can shut down the machines and make a base snapshot to start each new project on.

Note: the general experience might improve in the RTM version, but if you’re using Hyper-V then you’re probably tech savvy enough to migrate the more difficult way Winking smile

Metro

A lot has been said about the Metro UI already. In Windows 8 there are two UI modes: Metro and Desktop (as I call them). Metro is the thing for mobile devices, slates and is very slick and touch driven (even if you can still operate it with a mouse and keyboard). Desktop mode is what we all know from Windows 7 and before.

Applications come in two forms; either it’s a Metro app (downloaded through the App Store), or a Desktop app (every piece of Windows software that is known to man). You can have a split screen of two apps.

Split Screen

The Start menu has been removed in favor of the Metro Start Page.

Metro Start Page

A lot of the navigation now happens by moving the mouse to a screen corner

  • Top Left will show the Metro Task Manager for app switching or dragging split screen
  • Bottom Left (where the Start Menu used to be) jumps to the Start Page
  • Top Right or Bottom Right will bring up the Settings Menu

Start Menu

I had the Windows 8 Developer Preview and there were some tools that allowed you to disable some Metro features so that you basically only had Desktop Mode (with Start Menu). It seems Microsoft is really pushing Metro and none of the tools to date allow this on the Consumer Preview.

I’m fine with using Metro since it’s a lot like my Windows Phone. I can get used to the Start Page by rearranging tiles, but in Desktop mode I do want my Start Menu back !!

ViStart to the rescue. Designed for Windows XP it renders the Vista or Win7 Start Menu with most functionalities you’d use it for. During some shutdowns it throws a buffer overrun or other error, but in general it works really great on Windows 8 and should Microsoft decide to permanently drop the Start Menu then this is your friend!

ViStart

The road goes on

It’s been only a few days since I installed it. I’m very pleased with overall performing and hope it will remain stable. Should things go wrong then I have an image of my previous OS at hand.


SharePoint Saturday Belgium 2012


March 1, 2012 - 16:31, by Steven Van de Craen - 0 Comments

Join SharePoint architects, developers, and other professionals on 28th April for the second Belgian ‘SharePoint Saturday’ event. SharePoint Saturday is an educational, informative & lively day filled with sessions from respected SharePoint professionals & MVPs, covering a wide variety of SharePoint-orientated topics. SharePoint Saturday is FREE, open to the public and is your local chance to immerse yourself in SharePoint!

SharePoint Saturday Belgium

SharePoint Saturday (#SPSBE) is organised by BIWUG (@biwug), the Belux Information Worker User Group.

BIWUG

Extra details and registration information can be found here: http://bit.ly/spsbe2012.

See you there,
@vandest1


 Next >>