Is Remote Desktop Services Better then Terminal services ?

Remote Desktop Services for Windows Server 2008 R2 is the latest edition in of Windows remote management services. Server administrators have used Terminal Services for years to access their servers from client workstations and end users have used a desktop variation (Remote Desktop Protocol, RDP) to connect to their work PC’s from home, and vice versa.

Licensing has always been the main difference between Terminal Services and RDP. RDP allowed for one end user at a time to connect to another client computer that had remote access enabled. Terminal Services was a server side utility that allows for multiple users to connect to one server, depending on the license allocations.

With Windows 7 client Remote Desktop services are still available and you can configure them as you traditionally have. What has significantly changed are the Server Utilities.

Server 2008 Terminal Server Enhancements

Windows Server 2008 delivered a new suite of Terminal Services, including Terminal Services Gatekeeper, Terminal Services Session Broker, Terminal Services Remote Applications and Terminal Services Web Services.

Microsoft had also moved the Terminal Services functionality away from IIS to a new role in its own right. By seperating this service away from IIS  has resulted in producing  a superior set of remote managed services.

For example, by configuring the Gatekeeper and Session Broker Services, remote users who need reliable connections can recover quickly from network failures or disconnects and resume their sessions. Additionally, users that only need access to a specific application, or set off applications, can access the Remote Applications through Web Services and work remotely on an application through a web browser interface.

Windows Server 2008 R2 Remote Desktop Services Enhancements

With Windows Server 2008 R2 the Terminal Services role service has been re-branded as Remote Desktop Services. All of the Terminal Services functions that Server 2008 provides are included – along with a whole new set of functional tools.

The newer Virtualization services are labeled as Virtual Desktop Interface (VDI), and Microsoft Enterprise Desktop Virtualization (MED-V). They now allow for remote users to access virtual computing environments, instead of the traditional one-to-one mapping for a RDP session to a physical computer.

A fully developed VDI and MED-V solution builds services on top of Microsoft’s System Center Virtual Machine Manager, Systems Center Configuration Manager, Systems Center Operations Manager, and Microsoft Desktop Optimization Pack – MDOP.  Then Remote Desktop Services can be configured to define and manage remote connections to these tools.

If you need assistance with setting up or configuring a Remote Desktop Service or Terminal service environment for your organisation we can help. Get in touch here.


Mobile Website Redirect Script

Having recently setup a mobile website to accompany our main corporate site I wanted to find a way of automatically redirecting all mobile traffic to the new site.

To do this I added the scripts below shown below.

<script type="text/javascript"> <!-- if (screen.width <= 699) { document.location = "mobile.html"; } //--> </script>

If you wanted to specifically target Iphone or Ipads then you could use the following

<script language=javascript> <!-- if ((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) {    location.replace("http://url-to-send-them/iphone.html"); } --> </script>


WordPress Login Trouble

WordPress Login Trouble

This post is a bit of a follow on from my last one which was about moving a wordpress site from a demo to a production environment.  Sometimes when moving sites from one host to another you may experience difficulties logging in to the dashboard.

Below are a number of possible solutions to assist you.

Enable Cookies

In order to make sure that cookies are enabled for your browser, you need to:

  1. Clear your browser cookies.
  2. Clear your browser cache.

To see how to clear cookies and caches on various browsers, visit Clearing Cache and Cookies.

WordPress MultiSite Network

  • Check your wp-config.php file.
  • Verify the DOMAIN_CURRENT_SITE value.

Disable Plugins

Some WordPress Plugins may interfere with the login process. Disable all of your WordPress Plugins, either through the admin panel or by removing them from the /wp-content/plugins/ folder, so they will not be recognized by the program.

Deactivate Theme

  • Rename the active theme folder (in wp-content/themes) by using FTP. Once renamed, WordPress will revert to using the WordPress TwentyEleven theme. When finally logged in, change to a different theme.
  • To find out what caused problem in the theme, upload and run this code when the theme is active:
<? ini_set('display_errors','1'); ini_set('display_startup_errors','1'); error_reporting (E_ALL);include('index.php'); ?>

New Login File

Sometimes the wp-login.php file may have been corrupted or uploaded incorrectly.

  • Delete wp-login.php off of your server and upload a new copy from a fresh WordPress download. Remember, overwriting file via FTP can lead to incomplete transfers.
  • Edit wp-login.phpas follows:
    • Go to the case retrievepassword section, found under this comment:
// redefining user_login ensures we return the right case in the email
Replace:
$user_login = $user_data["user_login"];
With:
$user_login = $user_data->user_login;

Edit Users Table

Access your site’s phpMyAdmin and edit the database carefully.

  • Open the WordPress database.
  • Click on the users table in the left menu (default is wp_users, or yourprefix_users if you defined a different table prefix.)
  • Click BROWSE.
  • Click on the EDIT button next to the admin user.
  • Delete whatever is in the password field.
  • Enter your desired password.
  • Froum the Function drop-down list, choose MD5.
  • Save the info in the database.
  • Log in to WordPress using “admin” and the password you used.
  • In the case of newer versions of WordPress, the password is double hashed, but as long as you md5 the password, it will complete the hash (it upgrades your password for you).

Password Problems

For information on problems logging in due to a wrong or lost password, see Resetting Your Password. Remember: the Username and Password fields are case sensitive.

Site URL Redirecting

In certain cases your WordPress address URI may have been reset.

  • Check the siteurl value in the wp-options table of your WordPress database. A guide to doing this is available here.
  • Is it set as http:/?
  • If it is, change siteurl to the correct value.
  • Open wp-login.php in a text-editor and comment or delete the following lines:
// If someone has moved WordPress let's try to detect it
//if ( dirname('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']) != get_settings('siteurl') )
 // update_option('siteurl', dirname('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']) );

Changed your WordPress address URI and cannot login nor access the database (but still can access the login page) ?

wp-login.php can be used to reset the address:

//FIXME: do comment/remove these hack lines. (once the database is updated)
update_option('siteurl', 'http://your.domain.name/the/path' );
update_option('home', 'http://your.domain.name/the/path' );

Subdomains or Subdirectories

In your wp-config.php try changing from:

define( 'SUBDOMAIN_INSTALL', true);

To:

define( 'SUBDOMAIN_INSTALL', false);

Secure HTTPS

If you are having a problem with secure HTTPS, change the following line in wp-includes/vars.php from:

define('COOKIEPATH', preg_replace('|http://[^/]+|i', '', get_settings('home') . '/' ) );

To:

define('COOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_settings('home') . '/' ) );

Be sure also to change the URL in OPTIONS to https://.

Headers Already Sent

If you get an error about headers already sent, see Solving the Headers Already Being Sent Problem in the FAQ.

Check Your URL Options

In some situations, your blog can be seen from inside your domain, but not outside. Following the instruction above about changing the wp-options MySQL table might still result in login failure.

In this event, double-check your wp-options table siteurl (WordPress address URL) and home (Blog Address URL) values to make sure they reference the same base externally available address; i.e., http://blog.yourdomain.com. The standard install may set them to your local (internal) host name, such as http://servername

Another issue may be if you are redirecting using .htaccess from a non-www url prefix to a www while you have the wp-options table siteurl (WordPress address URL) and home (Blog Address URL) set with non-www prefix. Consequently this would create an endless loop which you need to avoid. One way is to disable the .htaccess redirection temporarily by placing # before the line or eliminating the entries entirely and trying to Login again. Advanced users may want to adjust adjust the wp-options table siteurl (WordPress address URL) and home (Blog Address URL) through the database. Notice that this issue can also occur if you are redirecting from www to non-www but have your wp-options table siteurl (WordPress address URL) and home (Blog Address URL) set with a www url prefix.

Check your Firewall

Some firewalls (e.g., eTrust Personal Firewall) block you from logging in to WordPress. Disable your firewall and try to log in again.

http://www.bcmit.co.uk


Moving your wordpress site between hosts with no downtime

When we work with clients on developing there new website we use our own development environment to demo concepts and allow content to be proof read before the site goes live. The steps below go through the basics of moving your wordpress site to the new host

  1. Backup the database from the old site and import it to the new site. Ensure you make a note of the database name and the user details..
  2. Change your wp-config.php in the old site to point to the database on the new site. Your old site will now run using database based on the new site and once you change the nameservers new site will have the up to date database. (You may want to check with your new hosting if they allow outside database access first. If not, you can skip this step and transfer the database at the end, when the nameserver change propagated)
  3. Backup your entire WordPress installation from the old site (this will include all your uploads, themes, plugins)
  4. Upload the fiels that make up your wordpress site to the new site
  5. Change wp-config.php on the new site with new database details
  6. Change the nameservers to point to the new site
  7. Now wait for the DNS changes to happen

Since nameserver propagation can take up to one day, step 2 allows you to have up to date database at the moment it happens. Downside to this is slower site response in the meantime because site still runs from the old server and the database is on the new. But if you do this out of peak hours  it won’t be that noticeable and you will not lose any comments or other activity on your site.

 

BCM Website


Windows 8 Preview

Earlier this month Microsoft started to announce what we can expect to find in Windows 8. It looks like there is going to be a new UI which looks like is is based on the Windows Phone platform.

Have a look for yourself here

more information can also be found here


Configuring your Android OS Mobile to work with BPOS & Exchange

Having recently migrated a clients exchange solution to the Microsoft Cloud. I thought I would docuemnt how I went about setting up there HTC Wildfires to access emial on the move.

As you would expect there isnt a whole lot of literature on this so here goes

1)  Fom the Home screen  choose Menu > Settings > Accounts & Sync

2)Choose the option “Add Account”

3) Choose option “Exchange ActiveSync”

4) If given the choice opt to add settings manually and enter like listed below

Email Address: enter full email addres eg firstname.surname@domain.com

Server Name: enter the following for the UK & europe red002.mail.emea.microsoftonline.com

Domain: Leave this Blank

Username: This is your email address

Password: This is your account password

ensure that you tick the checkbox for “This server requires an encrypted SSL Connection”

Press Next and once the connection is established choose to synchronize Contacts, Calendar and Mail.

5. Modify the Account Sync settings as required. From the Home screen select Menu > Settings > Accounts & sync and choose the ActiveSync account just added. I recommend that you enable  Auto-sync and changing the sync schedule if you wish.

This is all you need to do in order to receive push email on your Android phone. In addition the rest of your email, contacts and calendar appointments will be synchronized between everything that uses your Exchange account for and any changes in one will be reflected in the others. For
example:

  • Send an email from your phone it will show up in the Sent items folder on Outlook
  • Add an appointment to your calendar in Outlook it will appear on your phone’s calendar and you will get a reminder on your phone
  • Receive a phone call and create a new contact on your phone from
    their number.

Hope you find this helpful


Re-size images quickly in windows 7

For all those people like me who miss little utilities like the windows xp power toys image resizer, I am glad to report I have found a alternative for windows 7 users. You can download it from here.

It is available in both 32 & 64 bit versions and will save you hours of messing about in graphics applications when all you really need to do is re size the image. its is as simple as right click on a image in windows explorer and resize.

 


10 Signs you need the Cloud

This post first appeared on Intel’s IT Galaxy blog earlier this month. Check it out – lot’s of good content there.

Cloud computing, data centre 3.0 – whatever you call it, the cloud is changing the way we do business, work, live our lives, and generally interact with data and services. But the weight of inertia is often on the first step – how can a company make the initial moves into the cloud? Here’s 10 simple signs that could mean it’s time you took a look at the cloud.

1) Your software licensing is a mess. You don’t know which PCs or users have licenses for which packages. And you are constantly having to delete licenses from user profiles in order to free up more versions of the software.

2) Your server workload fluctuates wildly and sometimes unpredictably.

3) Users are constantly reporting frustrations with a slow network, access to the database etc

4) You are many iterations behind on the latest versions of crucial applications that underpin your business.

5) IT tells you that you need to take the server offline in order to install upgrades, but your business can’t afford the downtime

6) IT costs are spiraling

7) Your workforce is frustrated – they want to have a more mobile productive working pattern but your IT constraints means their locked to your legacy desktops.

8) You’re increasingly concerned about your server’s green credentials.

9) Your business growth is unpredictable – you need flexibility but are worried fixed costs will constrain you.

10) You want more flexibility – in applications, storage and services.

If one or more of the above are affecting you and your business then get in touch now and see how we can help you and your business move to the cloud and give you the edge over your competitors.


Automating Tasks in Outlook with Powershell

One of the great things about PowerShell is the easy COM access it gives you, although sometimes it’s easy to forget.  Here are a few examples that may help give some ideas.  You can automate Outlook from tons of other languages as well, I’m just trying to get across how quick and easy it is using PowerShell.

Emptying your Deleted Items folder

$deletedItems = $outlook.Session.GetDefaultFolder(3) # == olFolderDeletedItems
$deletedItems.Items | %{ $_.delete() }

Create an appointment for tomorrow

$calendar = $outlook.Session.GetDefaultFolder(9) # == olFolderCalendar
$appt = $calendar.Items.Add(1) # == olAppointmentItem
$appt.Start = [datetime]::now + [timespan]::fromdays(1)
$appt.Subject = “Tomorrows Accounts Meeting”
$appt.Location = “My office”
$appt.Save()

 

Look at the subjects of the first 5 emails you sent

$sentMail = $outlook.Session.GetDefaultFolder(5) # == olFolderSentMail
$sentMail.Items | select -first 5 TaskSubject

Adding a contact

$contacts = $outlook.Session.GetDefaultFolder(10) # == olFolderContacts
$newcontact = $contacts.Items.Add()
$newcontact.FullName = “James Bond”
$newcontact.JobTitle = “Secret Agent”
$newcontact.CompanyName = “International Exports”
$newcontact.Save()


Creating Websites Using Powershell.

In this post I am hoping to show the steps involved to create Web-Sites, Web Applications, Virtual Directories and Application Pools using PowerShell.

The IIS PowerShell namespace consists of items like Web-Sites, Apps, Virtual Directories and Application Pools. Creating new namespace items and managing them is very easy using the built-in PowerShell cmdlets.

Creating Web-Sites

If you are familiar with PowerShell you know that the New-Item cmdlet is used to create new items in the various PowerShell namespaces. The command “New-Item c:\TestDirectory” creates a new filesystem directory for example (most people use the “MD” or “MKDIR” alias for New-Item however). New-Item is also used to create new Web-Sites within the IIS 7.0 PowerShell namespace.

Parameters

Specifying the name of the directory is the only argument needed when you create a new file system directory. Unfortunately this is not enough when you create a Web-Site. Additional parameters like the file system path and network bindings are needed to create a Web-Site. Here is the command to create a new Web-Site followed by a dir command:

PS IIS:\Sites> New-Item iis:\Sites\TestSite -bindings @{protocol=”http”;bindingInformation=”:80:TestSite”} -physicalPath c:\test

PS IIS:\Sites> dir

Name             ID   State      Physical Path                  Bindings
—-             –   —–      ————-                  ——–
Default Web Site 1    Started    f:\inetpub\wwwroot             http *:80:
TestSite         2    Started    c:\test                        http :80:TestSite

<bindings>
<binding protocol=”http” bindingInformation=”:80:TestSite” />
</bindings>Now here is the reason why we use a hash table: IIS configuration is completely extensible  with additional sections and attributes. You can imagine that somebody extending the <binding> element with additional attributes. Key value pairs within a hash table provide the flexibility to incorporate these new attributes without having to completely rewrite the IIS PowerShell Snap-in.

Granted, the syntax is a bit complex. We are thinking about wrapping some typical tasks like creating sites with additional functions or scripts in a later Tech Preview.

Deleting Sites

Here is how you delete the site you just created.

PS IIS:\ >Remove-Item IIS:\Sites\TestSite

Creating Web Applications

Creating Web Applications is easier than creating sites. Here we go:

PS IIS:\> New-Item ‘IIS:\Sites\Default Web Site\DemoApp’ -physicalPath c:\test -type Application Name                     ApplicationPool          EnabledProtocols         PhysicalPath
—-                     —————          —————-         ————
DemoApp                  DefaultAppPool           http                     c:\testThe only parameter you have to specify is the type (-type) because underneath a Web-Site you might want to create an Applications or a Virtual Directories. By specifying the -type parameter you tell the IIS Snap-in to create an application.

To delete the application you can also use Remove-Item.

Creating Virtual Directories

To create a Virtual Directory you also use the New-Item cmdlet. Let’s create a Virtual Directory underneath the ‘Default Web Site’ but and a second one underneath the Web Application we created in the previous step.

PS IIS:\> New-Item ‘IIS:\Sites\Default Web Site\DemoVirtualDir1′ -type VirtualDirectory -physicalPath c:\test\virtualDirectory1

Name                                              PhysicalPath
—-                                              ————
DemoVirtualDir1                                   c:\test\virtualDirectory1
PS IIS:\> New-Item ‘IIS:\Sites\Default Web Site\DemoApp\DemoVirtualDir2′ -type VirtualDirectory -physicalPath c:\test\virtualDirectory2

Name                                              PhysicalPath
—-                                              ————
DemoVirtualDir2                                   c:\test\virtualDirectory2

Creating Application Pools

But it gets even simpler. Creating a new AppPool only requires the name to be specified.

PS IIS:\> new-item AppPools\DemoAppPool

Name                     State
—-                     —–
DemoAppPool              {}

Simple, wasn’t it? Now let’s put this together to an end-to-end scenario.

Putting it all Together

In the following end-to-end scenario we will execute the following step:

  1. Create a set of new file system directories for the sites, web applications and virtual directories we will create a little later.
  2. Copy some very simple web content into the newly created directories.
  3. Create new Application Pool
  4. Create a new site, a new application and two new virtual directories and assign them to newly created Application Pool.
  5. Request the web content via the web browser.

Step 1: Create New Directories

We use the New-Item cmdlet to create four new file system directories. Execute the following commands (use ‘md’ instead of New-Item if you don’t want to specify the -type parameter):

New-Item C:\DemoSite -type Directory

New-Item C:\DemoSite\DemoApp -type Directory

New-Item C:\DemoSite\DemoVirtualDir1 -type Directory

New-Item C:\DemoSite\DemoVirtualDir2 -type Directory

Step 2: Copy Content

Now let’s write some simple html content to these directories:

Set-Content C:\DemoSite\Default.htm “DemoSite Default Page”

Set-Content C:\DemoSite\DemoApp\Default.htm “DemoSite\DemoApp Default Page”

Set-Content C:\DemoSite\DemoVirtualDir1\Default.htm “DemoSite\DemoVirtualDir1 Default Page”

Set-Content C:\DemoSite\DemoVirtualDir2\Default.htm “DemoSite\DemoApp\DemoVirtualDir2 Default Page”

Step 3: Create New Application Pool

Create the new Application Pool ‘DemoAppPool’ for the new site if you deleted the one we created in the previous sample.

New-Item IIS:\AppPools\DemoAppPool

Step 4: Create New Sites, Web Applications and Virtual Directories and Assign to Application Pool

Here comes the beef. We create DemoSite, DemoApp and two Virtual Directories – DemoVirtualDir1 is directly underneath DemoSite and DemoVirtualDir2 is underneath DemoApp. We are assigning DemoSite and DemoApp to DemoAppPool created in the previous step. DemoSite is assigned to port 8080 to not conflict with the ‘Default Web Site’

New-Item IIS:\Sites\DemoSite -physicalPath C:\DemoSite -bindings @{protocol=”http”;bindingInformation=”:8080:”}

Set-ItemProperty IIS:\Sites\DemoSite -name applicationPool -value DemoAppPool

New-Item IIS:\Sites\DemoSite\DemoApp -physicalPath C:\DemoSite\DemoApp -type Application

Set-ItemProperty IIS:\sites\DemoSite\DemoApp -name applicationPool -value DemoAppPool

New-Item IIS:\Sites\DemoSite\DemoVirtualDir1 -physicalPath C:\DemoSite\DemoVirtualDir1 -type VirtualDirectory

New-Item IIS:\Sites\DemoSite\DemoApp\DemoVirtualDir2 -physicalPath C:\DemoSite\DemoVirtualDir2 -type VirtualDirectory

Voila. All that’s left is to request the web content.

Step 5: Request the Web Content

You can of course open the browser and enter http://localhost:8080/ and all the other URLs. But its a PowerShell walkthrough and we’ll use PowerShell to do it by using the .NET WebClient classes:

$webclient = New-Object Net.WebClient

$webclient.DownloadString(“http://localhost:8080/”);

$webclient.DownloadString(“http://localhost:8080/DemoApp”);

$webclient.DownloadString(“http://localhost:8080/DemoVirtualDir1″);

$webclient.DownloadString(“http://localhost:8080/DemoApp/DemoVirtualDir2″);

If you feeling adventurous you can also use Internet Explorer object itself:

$ie = new-object -com InternetExplorer.Application

$ie.Visible = $true

$ie.Navigate(“http://localhost:8080/”);

Summary

In this walkthrough you learned how to create Web-Sites, Web Applications, Virtual Directories and Application Pools with PowerShell. Additional PowerShell features were used to build a functional end-to-end scenario.

Happy Coding


Follow

Get every new post delivered to your Inbox.