Archive for January, 2010

Allowing remote desktop to a Hyper-V host or virtual machine – Part 3

Sunday, January 31st, 2010

So now let’s say that you want create firewall entries that port forward RDP requests to specific VMs running on your Hyper-V host. Again, you need to first make sure that each VM has a unique IP address on your local area network, can access the Internet through your firewall, and has RDP enabled as described previously.
So in this example, I have two VMs at 192.168.1.110 and 192.168.1.111. I’m going to pick ports 57110 (a custom port which I’m calling RDP VM1) and 57111 (which I’m calling RDP VM2) to forward to those respective IP addresses.

blog4

Now, if I try to RDP from an external address to router external address:57110 or 57111 my connection will automatically be forwarded to one of the VMs running on my Hyper-V host.

Share

Allowing remote desktop to a Hyper-V host or virtual machine – Part 2

Sunday, January 31st, 2010

In the last update, I talked about what you need to do on the host computer or virtual machines to allow Remote Desktop connections. This time I’ll take a look at setting up your firewall to forward external RDP requests to the appropriate computer or VM. This is known as port forwarding, and will vary from one firewall application and router to another.
On my router, a Verizon FIOS router, this is found under Firewall Settings, Port Forwarding.
Here, I’ve created an entry for TCP port 3389 to forward to 192.168.1.100, my Hyper-V host computer on my internal network.

blog3

Next you need to know what your external IP address is on your router/firewall. This can be done by browsing to http://whatismyipaddress.com/. In order to test that it’s actually working, you can either have a friend try to connect by opening up a Remote Desktop Connection to your external IP address. If you assigned a different port, you will need to specify that here.

Share

Allowing remote desktop to a Hyper-V host or virtual machine – Part 1.

Sunday, January 31st, 2010

I run a lot of computers as virtual machines under Hyper-V. Occasionally, it’s nice to be able to provide someone outside of my local network access to my Hyper-V server or a guest VM on the Hyper-V host. We can do this by enabling RDP, or Remote Desktop Protocol.
In part one I’ll discuss how to set this up internally, assuming your Hyper-V host computer is behind a firewall.
To enable RDP access your Hyper-V host and all VMs on this machine, then you need to do four things:

    1. Make sure that this machine has access to the Internet, preferably via NAT over your firewall/router
    2. Make note of the IP address for the Hyper-V host computer
    3. Enable remote connections in the System Properties dialog box, on the Remote tab. (fig. 1)
    4. Enable RDP to this computer in Windows Firewall with Advanced Security (fig. 2)

Fig. 1:
blog1
Fig. 2:
blog2
To enable RDP to the Hyper-V host, open Windows Firewall with Advanced Security, then in Inbound Rules, make sure that Remote Desktop (TCP-In) is enabled.

To enable RDP to a guest VM, you need to do the same thing: make sure that the computer can access the network (this can usually be accomplished by assigning one of the virtual networks configured for the VM to the External network), make note of the IP address for the VM, and finally enabling the RDP protocol on the firewall for the VM.
At this point, you should be able to connect to the Hyper-V host and any VMs that have a valid IP address for your local area network. Test it to verify.

Share

PowerPivot for SharePoint

Sunday, January 31st, 2010

Now that PowerPivot for SharePoint is properly installed, you are ready to begin sharing an managing PowerPivot workbooks created in PowerPivot for Excel. If something is not working quite right, you might want to go back to my previous blog and verify your installation procedure.

I have already discussed using PowerPivot for Excel to create workbooks and worksheets to analyze data, so we will continue the discussion with sharing and managing those workbooks using PowerPivot for SharePoint.

PowerPivot for SharePoint consists of the PowerPivot System Service and the SQL Server 2008 R2 Analysis Services in VertiPaq Mode. Excel Calculation Services runs on top of these to provide the facility for sharing and reusing the Excel-based PowerPivot workbooks.

A web browser accesses the service using the Excel Web Access web part. Accessing a PowerPivot workbook with a browser enables anyone to load the workbook and interact with it live without the aid of additional software on the browser computer. The web part enables the user to manipulate the data using the slicers and filters configured when the workbook was created. Selecting and deselecting slicers and filters sends a query back to the PowerPivot System Service for processing and the resulting data is returned to the browser window within seconds. The results are based on the last data set saved with the workbook. If the latest data is required, the browser window includes options to refresh the data.

Another option in the browser window is to open the workbook in Excel. Keep in mind that this requires Excel 2010 with PowerPivot installed to work properly. When the workbook is loaded in Excel, all of the functions in PowerPivot for Excel are available to the user. This includes changing of the layout, slicers, filters, and value fields. The workbook also includes the cached data from the latest data refresh. After making changes to the workbook, it must be uploaded to SharePoint to make the changes permanent.

That is a quick tour of the workbook access layers. Now let’s look at some of the server side features that make PowerPivot for SharePoint such a powerful tool for self-service business intelligence.

The PowerPivot System Service is the middle application layer that handles requests for queries, including data refresh queries. The queried data is initially cached in the workbook itself. However, data refresh requests are forwarded to Analysis Services and the result set is passed back to the client or server application. Each new data refresh is cached by the service for faster response times on subsequent queries from the same client, and from other clients accessing the same workbook with the same data set.

Data refresh jobs can be created in PowerPivot for SharePoint to ensure that the data used in a specific workbook is accurate and up to date based on a set schedule. The jobs are assigned a suggested start time. That means that the job is scheduled to begin no earlier than the start time. However, it does not guarantee that the job will start at that time. PowerPivot has a special start time called “after business hours” which you define in the configuration settings. This option is provided as a default to assist in scheduling data refresh jobs for times that will have the least impact on network performance.

The System Service also manages active and cached connections to Analysis Services. These connections are generally added to connection pools based on the in-memory data source they use. If twenty users are accessing the PowerPivot data set for period-end accounting transactions, the data is cached in memory and each connection is pointed to the same data set.

Active PowerPivot data sets in-memory data sets. Basing the data set in memory enables PowerPivot to manipulate and evaluate millions and millions of rows of data without the burden of hardware I/O slowing down the process. These in-memory data caches are monitored for activity and cached to disk if there is no activity within a specified period of time. The default is 30 minutes without activity.

There are two monitoring jobs that the PowerPivot System Service performs to assist in server management. The first is the collection of usage data to assist in monitoring connections, data cache loads and unloads, query reporting and server status. The data is compiled and made available as both an entry in the PowerPivot Management Dashboard, and excel spreadsheets.

The other task is monitoring server health. In a single server farm this is useful for server and performance diagnostics. If the PowerPivot is installed on a multi-server farm, the monitoring assists in load balancing. Load balancing is performed in a round robin format by default. However, for larger farms it may be advisable to set the Service to perform load balancing based on individual server help.

Now we are down to the lowest layer of PowerPivot for SharePoint, SQL Server 2008 R2 Analysis Services. The new version of Analysis Services includes PowerPivot for SharePoint when installed with SharePoint integration. The Analysis Services engine runs in VertiPaq mode. VertiPaq mode provides the mechanism for in-memory caching of the extremely large data sets used by PowerPivot. The data set is stored in memory using highly optimized compression. Without the in-memory cache, it would quickly become impractical to provide the volumes of data the users require to create meaningful business intelligence solutions. Analysis Services manages the data within the cache by restructuring the data based the slicers and filters selected in a PowerPivot workbook. By providing this restructuring and query capability in memory, the users experience extremely fast response times.

I should mention that Analysis Services in VertiPaq mode does not support traditional OLAP options. If you need to perform operations against traditional cube databases on the same server you can install another instance of Analysis Services that is not in VertiPaq mode for this purpose.

This is a very brief overview of some of the most important things to know about PowerPivot for SharePoint and how it works. So far, I have found PowerPivot for SharePoint and PowerPivot for Excel to be amazingly, and deceptively, simple to install and place into production. The functionality provided by PowerPivot promises some very exciting days ahead for all of the users that have had to wait for days, months, or even years for the creation of a custom business intelligence solution to provide answers to pressing issues. These users will soon find themselves creating business intelligence solutions that answer all of their questions and more in as little as a few minutes.

Share

Necessity

Sunday, January 31st, 2010

This is somewhat of a philosophical post, so bear with me here!  I find the application development process itself to be really interesting and so it’s something that I think about at times.  As a person who writes samples, articles, demos, and other content for  products, it’s pretty common for me to actually need to come up with the idea for the software – not just the software itself.  This is backwards from most software development.

Think about it – an enterprise developer creates software that speeds up or reduces errors for the company’s people.  A “dot com” developer creates a site that addresses some need in order to bring in people for advertising, subscriptions, or what have you.  A hobbyist developer creates a solution to a problem that s/he is having – a magazine collector wants a tool to assist with the collection, and a musician might want a tool for keeping track of gigs.  The bottom line is, as the old proverb goes, necessity is the mother of invention.

Not so with people like me!  The necessity in this case is the need to create interest and provide help with a product or technology.  I end up racking my brain for a scenario that is somewhat realistic and demonstrates the necessary attributes of the product.

As an example, let’s say that I need to come up with a sample of the new file drag-and-drop feature in Silverlight 4.  Drag and drop is nothing new, but it’s new to Silverlight.  I could create an almost “Hello World” style of sample that just exposed a panel, and when a file was dropped it would display the filename.  That’s a pretty basic sample, and a pretty common way to demonstrate something – just create something quick and dirty that shows it.  It’s not very compelling though, and in the end it doesn’t create much more benefit that a paragraph or two of SDK documentation would provide.  The key is to demonstrate real benefit.

Part of a sample is showing how the code works, but an arguably bigger part is showing why you would want it to work that way.  A drag-and-drop panel satisfies the former requirement, but not the latter.  A better example would be the classic file uploader applet.  As you drag files, they get added to a queue and then upload in the background.  This is a clear benefit to a form submission method of uploading files.  It makes sense, it’s quickly graspable, and with some tweaking could probably even be adapted for actual use on a web site.

There is a balance though.  A sample shouldn’t have so much going on that the demonstrated technology is lost.  It should be easy to factor out the rest and focus on the feature of interest.  In the file uploader example, the queuing and uploading needs to be in separate classes so the work of accepting a dropped file is obvious, clear, and adaptable for other needs.

A sample, demonstration, or article that includes code that meets these criteria is considered a success by me.  Doing this on a project with multiple samples, and over multiple projects can be quite a challenge.  It’s very rewarding to get it right though!

Share

SharePoint 2010 and PowerPivot for SharePoint

Saturday, January 30th, 2010

In my previous blogs, I looked at PowerPivot for Excel and how it enabled the average user to access and analyze data without the aid of an IT professional. However, the advantages do not stop there. The other side of making business decisions is the sharing of those decisions along with the data used to support them.

PowerPivot for SharePoint 2010 is part of the new SQL Server 2008 R2 Analysis Services when installed with SharePoint integration. Installing PowerPivot for SharePoint looked to be a simple matter. However, I found that there are some very important planning steps required for a smooth installation.

I was fortunate enough to begin with a clean slate. Because PowerPivot for SharePoint only works with SharePoint 2010, and because SharePoint 2010 is in beta, I had the luxury of starting with the SharePoint installation. PowerPivot for SharePoint can be installed on an existing SharePoint Server, or on a newly installed server. If your organization is planning to use PowerPivot for SharePoint, seriously consider installing both products at the same time. Waiting until your SharePoint server is configured and well established means that much of the PowerPivot installation and configuration will require manual efforts.

The following are the most important things I learned while installing both products:

  • SharePoint 2010 Beta
    • Both SharePoint 2010 and PowerPivot for SharePoint require the 64-bit version of Windows Server 2008 SP2 or R2. I used Windows Server 2008 R2.
    • The minimum 4GB of RAM really is the minimum, at least for installation. SharePoint 2010 Beta would not install properly with less RAM. Believe me, I tried. Using Hyper-v virtual machines to create the server requires some tweaking of RAM to make sure resources are available for other virtual machines in a demo setup. After completing the install and configuration of the SharePoint 2010 and PowerPivot virtual machine, I was able to run the server with 2GB of RAM. This made it run very slow, but it did run fine. If possible, I would run with the full 8GB that is recommended.
    • 80 GB of disk space is recommended. However, PowerPivot caches data to speed retrieval and will require considerably more space. Remember that PowerPivot is designed to handled many millions of rows of data and plan accordingly.
    • If you run SharePoint 2010 on Windows Server 2008 R2 you need to download the Windows6.1-KB976462-v2-x64.msu hotfix file located at http://go.microsoft.com/fwlink/?LinkID=166231. The file fixes an issue that prevents PowerPivot data refresh and the PowerPivot Management Dashboard from working properly. Interestingly, this hotfix is apparently automatically installed as part of the Windows Server 2008 SP2 setup.
    • SharePoint 2010 should be installed using the Server Farm option on the Choose the installation you want dialog. Choose this option even if the server will be the only one.
    • Make sure and select the Complete option on the Server Type dialog.
    • Do not run the SharePoint Configuration wizard after the install process is complete. The PowerPivot for SharePoint installation will take care of all configuration tasks for you. If you forget and run the wizard, you will be forced to configure everything for PowerPivot manually.
  • PowerPivot for SharePoint – SQL Server 208 R2 Analysis Services
    • Run the SQL Server 2008 R2 setup application.
    • On the Feature Role dialog select Analysis Services with Sharepoint Integration and be sure an change the Install Analysis Service in option to A new farm (install separately). This tells the PowerPivot portion of the setup to configure the new SharePoint server with the necessary settings to run PowerPivot.
    • Download and run the SQLSERVER2008_ASAMO10.msi file located at http://go.microsoft.com/fwlink/?LinkID=168693&clcid=0×409. The SQL Server 2008 R2 Analysis Services OLEDB Provider version 10.5 update is required on each PowerPivot for SharePoint server to enable smooth data connections between clients and Analysis Services for data refresh.
    • The Analysis Services service account must be a domain account. Setup will display an error if you try to use the local machine Service or Network Accounts.
    • PowerPivot Service Application Pool accounts must also be domain accounts. When installing PowerPivot on multiple servers in a farm, this account does not necessarily need to be the same for all servers. The account requires connect, read, and write permissions to the PowerPivot service application database.
  • SharePoint settings in SharePoint 2010 Central Administration
    • Change the value in Maximum upload size under Application Management | Manager web applications | SharePoint – 80 to 2047. This will allow PowerPivot workbooks of up to 2GB in size to be uploaded to the SharePoint PowerPivot Gallery.
    • In the Application Management | Manage service applications | ExcelServiceApp1 | Trusted File Locations | http:// change the following values:
      • Change the Maximum Workbook Size to 2000.
      • Change the Maximum Chare or Image Size to 10,

If you followed all of these recommendations, your SharePoint 2010 server with PowerPivot is ready to go!

In my next blog, I will look at what PowerPivot for SharePoint adds to the SharePoint server.

Share

Building Communities

Saturday, January 30th, 2010

At Aeshen, we are often tasked with figuring out how to build up a community around a given product or technology.  This is an important step in assuring success.  Building up a community around something can be the difference between being a blip on the radar and taking the world by storm.  Building up a community isn’t easy though, and it requires careful intervention from a product’s caretakers in order to see it through.

One way to get the ball rolling is to get the word out as early as possible.  This is a great first step to discover the need.  Early blog posts, articles, and references can really make a difference.  Once people are expecting a technology, they start to really think about how it would change things, and there will be a pent-up demand for it to be released as quickly as possible.

Once people are talking about it, it’s important to get them together.  Creating blogs with commenting and hosting chats can gauge interest further, but also enable people to share their thoughts.  At this point, no one can do much more than conjecture, but as more blog posts and other communications emerge, the discussion will become more focused.

Releasing videos of products or interviews with designers/architects can also get people more interested as they are getting a more in-depth look as what they can expect.

When it’s time to release the technology, it’s vital to have as much content available as possible from day one.  Everyone loves to download that new library, but API documentation is only going to take them so far.  Creating samples is really a requirement.  Creating hands-on-lab documents with detailed explanation of steps get people thinking in the right mindset for getting the most out of it.

With all of these people working with samples and labs, having forums is really important.  This is where people can shine by showing off their knowledge to others and learning together.  Give people points for participating, allow discussions to be flagged as good or bad, and use a layout that allows good content to float to the top easily.  All of this gets people talking, learning, and ultimately using the technology.

Finally, a good community must be nurtured.  Make sure that you have official responses from time to time, release additional samples, talk about upcoming versions, allow users to vote on bug fixes and features.  All of this will make the difference between a few people trying something out, and a community of people passionately evangelizing your work with you.

Share

LINQ to SQL – Part 2

Saturday, January 30th, 2010

In my last post I talked about how LINQ to SQL greatly simplifies working with database tables in your code.  No longer do you need to sprinkle SQL throughout your code and iterate through results to create business objects.  LINQ handles it all for you so you can concentrate on what to do with those objects.

What’s amazing is how well LINQ to SQL’s query generator works.  If you have started using LINQ to Objects, you know how great it is to find specific objects in a collection, to sort, and even create secondary objects from data.  All of this is amazing, but extension methods make it fairly easy to understand what’s happening behind the scenes.  When you work with LINQ to SQL, you include the use of a DataContext object.  This is where the magic happens.

A DataContext encompasses details about how the database relates to the business objects.  This is where you declare that a Person object is an instance of a row from the Persons database table, and the object properties relate to columns.  From there, all CRUD operations can be easily generated.

Simple operations are easy enough, but when you start layering on operations like grouping, Take(), and Skip(), the query  generation really shines.  The DataContext creates an expression tree based on your query, and then executes it when used.  This is called deferred execution and is an important distinction.  Merely assigning a query to a variable, like this:

var people = from p in DC.People where FirstName == “John” select p;

does not result in any SQL queries being sent.  It’s not until you work with the collection that data is retrieved.  This makes it possible to reuse a query throughout your code and always have fresh data.  If you want to cache your results, simply call ToList() on the query, and it will execute right there.  Basically, as long as it’s an enumerable it will execute on each enumeration.  Once converted to a list, the results are static.

There are many great resources out there to learn more about LINQ to SQL.  Fire up AdventureWorks, Northwind, or your favorite sample data and start trying it out!

Share

SQL Azure Connection String

Friday, January 29th, 2010

I started working with SQL Azure while having only minimal experience with SQL Server. Coming from an IT Pro background and not a developer, it took me a little while to find out how to convert a local database to a SQL Azure database. If you would like a developer take on SQL Azure, my colleague wrote a nice blog about it here. After establishing the database on the SQL Azure server, you need to edit the application’s connection string to point to the new database. To do this, you need to open app.config and change a few properties in the connection string. Before you begin, you need to know the SQL Azure Server Address. You can find this on the Server Administration page for SQL Azure: https://sql.azure.com .

• The first change is to replace the Data Source statement with a Server statement. The server address must be entered exactly as it appeared on the Server Administration page.

• Next, you need to replace the Initial Catalog statement with the Database statement. It is important to indicate which database you want to connect to, otherwise SQL Azure will assume the master database.

• The Integrated Security statement needs to be replaced by the User ID, Password, and Trusted_Connection statements. The user id value corresponds to user id created for use by the application. Trusted_Connection needs to have a value of False.

• Finally, MultipleActiveResultSets needs to have a value of False.

Share

DirectAccess: Troubleshooting Tips

Friday, January 29th, 2010

While working with DirectAccess, I discovered a few troubleshooting tips to try if DirectAccess is not working correctly after you have configured it through the DirectAccess console. I would try the following steps and check to see if DirectAccess is working after each step.

  • Reapply the DirectAccess setup. Open up the DirectAccess console on the DirectAccess server, and click Apply. All your previous configurations will already be there from the first time you applied the settings.  
  • Run gpupdate on the client while connected to the domain, disable the domain adapter, and then reboot the client.
  • Reboot the DirectAccess server, and then reboot client again.
  • Check DNS again to make sure BOTH an IPv4 and IPv6 address are listed for each machine involved in DirectAccess communication (this will be at a minimum the DirectAccess server, the Domain Controller, and the client).
  • Make sure network awareness is enabled on application servers. This setting is located in the Network and Sharing Center advanced settings.
Share