Tech blog

Solving problems

About
Contact

Installing and Activating the Remote Desktop Services License Server on Windows Server 2008 R2

leave a comment

So, you have purchased Microsoft Windows Server 2008 R2 and need to activate Remote Desktop Service Licence Server.

We have found following post here.

Unless licensing is configured during the initial installation of the Remote Desktop Services role on Windows Server 2008 R2, a 120 day grace period is provided before a license server needs to be installed and activated.

Installing the Remote Desktop Services License Server

The first step is to install the Remote Desktop Services License Services server role. The license server does not necessarily have to be installed on a system which is acting as a Remote Desktop Server. The installation can be performed using by selecting Roles from the tree in the left hand panel of the Server Manager tool.

If the server is already configured with the Remote Desktop Services role, scroll down the Roles summary page to the Remote Desktop Services section click on the Add Role Services link. In the resulting dialog titled Select Role Services select the check box next to Remote Desktop Licensing and then click Next to proceed to the Configure discovery scope for RD licensing screen as illustrated in the following figure:

In the first version of Windows Server 2008, it was necessary to specify a method by which RD Session Host servers (or Terminal Servers as they were known then) would auto-detect the server running the licensing server. With Windows Server 2008 R2, this approach is discouraged, and Microsoft now recommends that each RD Session Host be manually configured with information about the license server. In keeping with this recommendation, leave the Configure a discovery scope for this license server option unselected. Note, however, that this setting may be changed at a later time if required via the RD Licensing Manager tool. Click Next to proceed to the confirmation screen.

On a server which is does not have the Remote Desktop Services role installed, open the Server Manager, select Roles from the tree in the left hand panel and select Add Roles. Click Next on the initial screen if it appears so that the Select Server Roles screen is displayed. From the list of roles select the check box next to Remote Desktop Services and click on the Next button.

Read the information screen and then proceed to the Select Service Roles screen. Check the box next to Remote Desktop Licensing, click Next and follow the steps outlined above.

On the confirmation screen, verify that the information matches your expectations and click Install to initiate the installation process.

Activating the RD License Server

Once the RD License Server has been installed the next task is to activate it. This task is performed using the RD Licensing Manager which may be launched via Start -> All Programs -> Administrative Tools -> Remote Desktop Services -> Remote Desktop Licensing Manager. Once started, the Remote Desktop Licensing Manager dialog will appear containing a list of detected license servers on the network. The only license server listed in the following figure is the one on the local server. Because this has yet to be activated it is listed with a red circle containing an X mark next to it:

https://activate.microsoft.com web site using a browser and enter the product ID. Alternatively, if an internet connection is not available or a firewall prevents such access the activation may be performed over the telephone. If Automatic connection is selected, the following dialog will appear as the wizard attempts to contact Microsoft:

Once the Microsoft activation server has been located a new dialog will appear prompting for user, company and geographic location information. Complete these details and click Next to proceed. The second screen requests more detailed, but optional information. Either complete this information or click Next to skip to the activation process. Once again the wizard will contact Microsoft and complete the activation. Once completed, the following completion screen will appear:

Note that the Start Install Licenses Wizard now check box is selected by default. If you are ready to begin installing Client Access Licenses (CALs) now click on Next.

Installing Client Access Licenses (CAL)

A Client Access License (CAL) is required for each client requiring access to Windows Server 2008 R2 Remote Desktop Services. Once an RD License Server has been installed and activated the next step is to install the CALs. This can be performed as a continuation of the RD License Server activation process as outlined above, or at any other time by opening the RD Licensing Manager, right clicking on the appropriate license server in the list and choosing Install Licenses from the popup menu.

Once the Install Licenses wizard has started, click Next on the welcome screen to select the type of license program being used. Select the appropriate license type from the drop down list depending on how the licenses were acquired and then click Next to enter the license codes. On the License Program screen enter each code and press the Add button:

Select the license program corresponding to your license and click next to proceed to the License Code screen:

Enter each license key into this screen followed by the Add button. Once all the license codes have been added click on the Next button to complete the license installation process.

Configuring Licensing Settings on RD Session Hosts

Assuming that you followed Microsoft’s recommendation to manually configure the license server information for each RD Session Host it will now be necessary to perform this task. On each RD Session Host invoke the Remote Desktop Session Host Configuration tool by selecting the Start -> All Programs -> Remote Desktop Services -> Remote Desktop Session Host Configuration menu option. Within this tool, double click on the Remote Desktop licensing mode entry located in the Edit settings box listed under Licensing. In the resulting Licensing tab of the properties dialog select the appropriate licensing mode (per device or per user). Having defined the licensing mode, the next task is to specify the licensing server. Beneath the mode selection area, click on the Add… button to display the Add License Server dialog as illustrated in the following figure:

All known license servers will be listed in the left hand box. If the required servers are listed, select them and add them to the list of specified servers by clicking on the Add> button. If a server is not listed, manually type the name or IP address of the server in the text box provided and click the corresponding Add> button. Once all the required servers have been specified, click the OK button to commit the changes and dismiss the dialog.

VN:F [1.9.3_1094]
Rating: 0.0/5 (0 votes cast)
VN:F [1.9.3_1094]
Rating: 0 (from 0 votes)

Detect Browser in CSS

leave a comment

Sometimes you need to detect browser version in CSS in order to apply additional, browser specific, properties to the same class.

Here are the ways for selecting specific versions of Internet Explorer by using followind conditional comments:

  • IE 6 and below

    • Use * html {} to select the html element.
  • IE 7 and below

    • Use *:first-child+html {} * html {} to select the html element.
  • IE 7 only

    • Use *:first-child+html {} to select the html element.
  • IE 7 and modern browsers only

    • Use html>body {} to select the body element.
  • Modern browsers only (not IE 7)

    • Use html>/**/body {} to select the body element.

Example for IE7 only (change left padding to 5px instead of 20px as it is for other browsers)

.your_css_class
{
	color: #000;
	padding: 20px;
	background: #fff;
}

/* IE7 hack */
*:first-child+html .your_css_class
{
	padding-left: 5px;
}
VN:F [1.9.3_1094]
Rating: 0.0/5 (0 votes cast)
VN:F [1.9.3_1094]
Rating: 0 (from 0 votes)

How to clear recent servers list in MS SQL 2005 Management Studio?

leave a comment

So, you have Microsoft SQL Server 2005 Management Studio (SSMS) and when trying to connect “Server name” drop down list is filled with sensitive data:

To clear this list, all you have to do is delete this file:
C:\Documents and Settings\<user>\Application Data\Microsoft\Microsoft SQL Server\90\Tools\Shell\mru.dat.

Just remember, once you delete that file all of your previous connections will be lost. So make sure that you have any necessary IP addresses, usernames, and passwords that you’ll need to reconnect to your favorite/most used SQL Servers.

VN:F [1.9.3_1094]
Rating: 0.0/5 (0 votes cast)
VN:F [1.9.3_1094]
Rating: 0 (from 0 votes)

Javascript Sleep or Wait function

leave a comment

This can be one possible implementation (not very clean, but working):

function sleep(numberMillis){
	var now = new Date();
	var exitTime = now.getTime() + numberMillis;
	while (true){
		now = new Date();
		if (now.getTime() > exitTime) return;
	}
};
VN:F [1.9.3_1094]
Rating: 0.0/5 (0 votes cast)
VN:F [1.9.3_1094]
Rating: 0 (from 0 votes)

How to boot Windows 2008 R2 Server from usb drive/stick

leave a comment

We had to install Windows 2008 R2 Server on HP ProLiant ML150 G3 server and we decide to do this booting and installing it from USB stick. We have a 4GB USB stick and it is enough.

Diskpart tool is excellent way to do this task. If you don’t have Diskpart, you can download it here.

Format the thumb drive

  1. from a DOS prompt execute: diskpart
  2. list disk
  3. select disk 1 (assuming disk 1 was your thumb drive in the above list disk command)
  4. clean
  5. create partition primary
  6. select partition 1
  7. active
  8. format fs=fat32
  9. assign
  10. exit

Copy the Win2008 install files

  1. xcopy d:\*.* /s/e/f e:\ (assumes your dvd is drive D: and your thumb drive is drive E:\, adjust accordingly)
VN:F [1.9.3_1094]
Rating: 0.0/5 (0 votes cast)
VN:F [1.9.3_1094]
Rating: 0 (from 0 votes)

Random sorting using LINQ

leave a comment

Random Sort

Consider the below Person class:

public class Person
{
    public int Id
    {
        get;
        set;
    }
    public string Name
    {
        get;
        set;
    }
}

This is how you can randomly sort the List object:

List list = new List();

list.Add(new Person { Id = 1, Name = "Davolio Nancy" });
list.Add(new Person { Id = 2, Name = "Fuller Andrew" });
list.Add(new Person { Id = 3, Name = "Leverling Janet" });
list.Add(new Person { Id = 4, Name = "Peacock Margaret" });
list.Add(new Person { Id = 5, Name = "Buchanan Steven" });
list.Add(new Person { Id = 6, Name = "Suyama Michael" });
list.Add(new Person { Id = 7, Name = "King Robert" });
list.Add(new Person { Id = 8, Name = "Callahan Laura" });
list.Add(new Person { Id = 9, Name = "Dodsworth Anne" });

list = list.OrderBy(x => Guid.NewGuid()).ToList();

Or you can use this approach:

Random random = new Random();
list = (from x in list
       let r = random.Next()
       orderby r
       select x).ToList();
VN:F [1.9.3_1094]
Rating: 0.0/5 (0 votes cast)
VN:F [1.9.3_1094]
Rating: 0 (from 0 votes)

Allowing WCF services (svc extension) in IIS7

one comment

  1. First, click on your website (or IIS7 website root)
  2. Click on MimeTypes and enter “.svc” and “application/octet-stream” and save
  3. In your project add this to your web.config in <httpHandlers> section:
    <add name=”svc-Integrated” path=”*.svc” verb=”*” type=”System.ServiceModel.Activation.HttpHandler, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″ preCondition=”integratedMode” />
    <add name=”svc-ISAPI-2.0″ path=”*.svc” verb=”*” modules=”IsapiModule” scriptProcessor=”%SystemRoot%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll” preCondition=”classicMode,runtimeVersionv2.0,bitness32″ />
VN:F [1.9.3_1094]
Rating: 0.0/5 (0 votes cast)
VN:F [1.9.3_1094]
Rating: 0 (from 0 votes)

Three essential plugins for Expression Blend

leave a comment

When it comes to vector graphics in Windows applications XAML is the most advanced format to choose from. XAML is great because developer/designer has full control over the graphics. Hidden reference lines, or garbage shapes, or objects can be relatively easily detected and removed from the code as compared to those formats that entirely rely on GUI editor.

A XAML document can be created with plain Notepad but there are great apps like Visual Studio, Expression Blend and Kaxaml that simplify editing. What is missing in those apps is lack of XAML exporting support, like saving .xaml to .png file. Luckily there are plugins to do just that.

xbprint is printing plugin for Expression Blend 3 hosted on CodePlex. Installation of the utility must be perfomed manually by extracting files to the Addins folder in Expression Blend directory. But once the plugin is installed it is easy to use. Set margins, alignment, paper size and click Print.

xbprint screenshot

xbraster is xaml to raster image converting plugin, a close relative to xbprint. Installation and use is similar. xbraster can convert XAML to PNG, JPEG, TIFF, GIF or bitmap.

xbraster screenshot

xbsprite is a sprite image generating plugin. Input xaml files are rasterized and combined in one image with optional CSS and HTML output for use on a web page.

xbsprite screenshot

For advanced and professional use of XAML xbprint, xbraster and xbsprite are must-have plugins.

EDIT: xbprint, xbraster and xbsprite can run directly from desktop – no need to have
Expression Blend installed.

VN:F [1.9.3_1094]
Rating: 0.0/5 (0 votes cast)
VN:F [1.9.3_1094]
Rating: 0 (from 0 votes)

July 5th, 2010

Thoughts on android mobile development

leave a comment

Intro
We like the taste of MVC in ASP .NET and have some practical experiences in coding Java applets, J2ME and Silverlight applications.

Lately our team decided to build a simple application for Android phone to try the platform. Story begins with an idea and motivation, installing and setting Eclipse + Android SDK, and like always, a sketch, todo list, etc.

Issues

  • For each property in layout xml the “android:” namespace is needed. Of course it can be replace with “a” but it still annoying to write it every time. Example <LinearLayout android:id=”@+id/pnlSomething” />   There is more advanced graphical xml standard – SVG
  • oops, I tried (miss-clicked) to run android as classic Java application but it returns an error (like build error),
    next time I try running as android application this error wont go away even if the code is fine
    solution: delete error from the error list and it should work fine :)
  • sometimes I run a debug and don’t notice the tiny icon in the far right bottom corner of eclipse
    that shows the application is launching and it’s stuck… and I try to launch it again, and again
    and applications are trying to launch parallel… solution: close eclipse and start again
  • connection refused on localhost? is this a joke? is only google.com allowed?
    firefox opens it normally, firewall is off, same on IIS and apache, permissions are set in manifest.xml
    reason: ‘localhost’ means the internal loopback of device (emulator) not the PC,
    solution: use your LAN IP
    //solution: edit hosts and set something like 127.0.0.1   pc-localhost //does not work
    http://groups.google.com/group/android-developers/browse_thread/thread/801645febf0523ea/9e779925e9570828
  • when a crash occurs it is just a crash, without detailed message or tip, developer should guess the error
    * and, BTW, emulator shows wrong time on windows (7:04 PM while the real time is 21:04 on GMT+1 timezone
    or 5:07 PM when the time is 19:07)
  • Record breaker among IDEs: 1.131 GB of RAM taken by Eclipse
  • A lot of features: social media, web, google maps, sqlite, bluetooth,
  • gestures, camera, speech recognition, 3D, processing…
  • s it easy to learn? theory yes, it is logical and quite simple, well documented;
    but dealing with basic practical issues is a pain

What really annoys us is that when we write layout in xml and we are confidant with it schema is right, works in theory, draws a preview but just don’t work in emulator Eclipse won’t tell what is the problem it just says “Source Not Found.”

Comparison: C# vs Java

A good programming language uses less code and effort to complete a task. What makes Silverlight (C#) coding easier and Android (Java) coding harder? Advantages of C# over Java or what is missing in Java:

  • lambda expression and Linq make handling data, arrays, xml easy
  • properties
  • partial types when dealing with large files
  • preprocessor directives (#if, #region) to bring visual focus on the particular part of code that is being developed and hide the other code
  • verbatim string, like @”C:\Program Files\android\sdk.exe” without escape characters
  • nullable types, like int? that can be -n…0, 1, 2…n or null
  • ‘yield’ keyword
  • ‘??’ operator
  • enumerations that are avoided in Android (Android uses constants, requires documentation to locate a constant)

* comparing to Silverlight you need to write more code in a more complex way for same features (ie. async, binding,
db, events)

* nullable types, like int? that can be -n…0, 1, 2…n or null
VN:F [1.9.3_1094]
Rating: 0.0/5 (0 votes cast)
VN:F [1.9.3_1094]
Rating: 0 (from 0 votes)

PDF files not Publish in ASP.NET MVC when deploying

leave a comment

We faced a problem when we added some PDF files into our media library of ASP.NET MVC website and noticed that these files are not Published automatically.
So you need in Visual Studio to click on each PDF file and under Properties (F4) just choose

  • Build Action=Content
  • Copy to Output Directory=Copy Always
VN:F [1.9.3_1094]
Rating: 0.0/5 (0 votes cast)
VN:F [1.9.3_1094]
Rating: +1 (from 1 vote)