Default Font Color Test

WordPress default for this theme:

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris nec augue euismod, vehicula dolor ut, lobortis orci. Aenean et nibh lacus. Proin diam leo, euismod vel imperdiet in, accumsan vel eros. Fusce condimentum dictum ultricies. Nam massa dui, varius in nisi vel, mollis blandit sapien. Nulla convallis mauris mi, fermentum lacinia ipsum venenatis ac. Morbi a vehicula turpis. Ut tempus orci quis ex pretium tincidunt. Etiam vel metus in leo ultrices pellentesque.

Cras hendrerit lacus erat, non placerat mauris ullamcorper sed. Ut laoreet, magna ornare efficitur pretium, massa justo mollis risus, ac suscipit felis ante aliquet ante. Donec eu volutpat eros. Nulla iaculis, libero sed dictum pretium, purus tortor aliquet elit, in lacinia augue nulla et urna. Suspendisse lacinia diam eu feugiat elementum. Vivamus feugiat felis mauris, vitae faucibus metus consectetur maximus. Proin lobortis pretium erat non tincidunt.

Font using in-line CSS:

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris nec augue euismod, vehicula dolor ut, lobortis orci. Aenean et nibh lacus. Proin diam leo, euismod vel imperdiet in, accumsan vel eros. Fusce condimentum dictum ultricies. Nam massa dui, varius in nisi vel, mollis blandit sapien. Nulla convallis mauris mi, fermentum lacinia ipsum venenatis ac. Morbi a vehicula turpis. Ut tempus orci quis ex pretium tincidunt. Etiam vel metus in leo ultrices pellentesque.

Cras hendrerit lacus erat, non placerat mauris ullamcorper sed. Ut laoreet, magna ornare efficitur pretium, massa justo mollis risus, ac suscipit felis ante aliquet ante. Donec eu volutpat eros. Nulla iaculis, libero sed dictum pretium, purus tortor aliquet elit, in lacinia augue nulla et urna. Suspendisse lacinia diam eu feugiat elementum. Vivamus feugiat felis mauris, vitae faucibus metus consectetur maximus. Proin lobortis pretium erat non tincidunt.

PDF files not included in Windows Search on Windows 7 and 8

As you probably know searching is the most efficient way to find documents, applications, and settings in Windows 7 and 8. By clicking on the Start button and typing you can quickly find files containing specific text and phrases.

The mechanism that allows this is Windows Search that runs as a Windows service. Windows Search has it’s roots in the Indexing Service that first appeared in NT4 and Internet Information Services (IIS). Indexing involves building a catalog (index) that contains the meta-data for files and applications. The meta-data is retrieved via plugins called IFilters.

Windows Search by default includes IFilters for common filetypes, including Word documents, Excel spreadsheets, PowerPoint presentations, HTML files, text files, MP3 and WMA music files, WMV, ASF and AVI video files and JPEG, BMP and PNG images. PDF files are indexed by Windows Search using an IFilter installed automatically when Adobe Reader is installed. However, on 64-bit versions of Windows the IFilter is not installed and the Indexing Service is unable to parse and index these files. Fortunately, the fix is easy and can be done without a reboot.

First, to confirm the IFilter is not installed you need to open Indexing Options in the Control Panel. To do this click on Start and enter the text index. Windows will search for anything with “index” and display the Control Panel option Indexing Options.

Search for Indexing Options

When selected the Indexing Option window appears. This window tells you the status of the Indexing Service, the number items in the catalog, and the options to add or remove search locations. In the following example my computer has indexed 12,033 items.

Indexing Options before installing the PDF IFilter

Click on the button Advanced and then click on the tab File Types. Scroll down to the PDF extension. If the IFilter has not been installed the filter description will state Registered IFilter is not found as in the following screenshot:

Missing IFilter in Indexing Options

After confirming the IFilter is missing you can close the Indexing Options window and download Adobe’s IFilter for 64-bit Windows. The current version as of the time of this writing is PDF iFilter 64 11.0.01 and can be downloaded from Adobe’s HTTP site or FTP site.

Once downloaded, you can install it using an elevated command prompt (run Command Prompt as administrator) with the following command:

msiexec /i “C:\Install\PDFFilter64Setup.msi” REBOOT=R /qb /L*v c:\temp\install_ifilter.log

After the installation completes go back into Indexing Options and confirm the IFilter was installed and registered. The following screenshot shows that the Indexing Service will use an IFilter named “PDF Filter”.
Installed IFilter

Now, all that is left to do is to rebuild Windows Search index. Click on the Index Settings tab and then on the button labeled Rebuild.
Rebuilding Windows Search index

After clicking the Rebuild button Windows will display a warning, click OK to start the rebuild.
Rebuild warning

The status of the rebuild can be monitored on the Indexing Options window. While you are using your computer Windows will reduce the speed of the indexing operation.

Eventually (within an hour or two, depending on size of catalog) the index will be rebuilt and now contain search items from PDF files. On my computer the number of indexed items increased to 40,913.
Indexing Options

List Mailboxes in Exchange 2010 using Powershell

This will list user mailboxes – mailboxes that are not resource mailboxes (rooms, calendars, etc.).

Does not work cannot match on actual word “False” (or “True”):

get-mailbox -resultsize unlimited | where { $_.IsResource -eq ‘False’ } | select Alias, Name, IsResource, IsMailboxEnabled | ft -auto

Instead you must match on the results of the evaluation:

get-mailbox -resultsize unlimited | where { $_.IsResource -eq $False } | select Alias, Name, IsResource, IsMailboxEnabled, OrganizationalUnit | ft -auto

Get number of user mailboxes:

$c = get-mailbox -resultsize unlimited | where { $_.IsResource -eq $False } | select Identity
$c.count

Google humor: shut your piehole!

I was reading the documentation for using Google’s Chart features – specifically the how to create a donut chart documentation. It was all pretty routine boring documentation until the last sentence.

These little jokes are one thing I have always liked about Google! For what’s worth I am probably not going to use Google Charts. I had an internal app that used Google Charts to generate a QR code. Unfortunately, Google decided to stop supporting the generation of QR codes and have deprecated this feature. It looks like I am going to go with Flot.

PowerShell E2010 is not installed on this machine

After applying an update roll-up to Exchange 2010 server I ran into a problem when running the powershell script UpdateCas.ps1. This is the script updates the OWA site in IIS to fix the error where OWA could not initialize (usually with the error Couldn’t find a base theme (folder name=base)). It appears this script must be run each time Exchange is updated.

Unfortunately, when I tried to run the script in EMS I received the following error:

[PS] C:\Users\Administrator.000>cd “C:\Program Files\Microsoft\Exchange Server\V14\Bin”
[PS] C:\Program Files\Microsoft\Exchange Server\V14\Bin>UpdateCas.ps1
Add-PSSnapin : The Windows PowerShell snap-in ‘Microsoft.Exchange.Management.PowerShell.E2010’ is not installed on this machine.
At C:\Program Files\Microsoft\Exchange Server\V14\bin\UpdateCas.ps1:36 char:13
+ add-PSSnapin <<<< -Name Microsoft.Exchange.Management.PowerShell.E2010
+ CategoryInfo : InvalidArgument: (Microsoft.Excha…owerShell.E2010:String) [Add-PSSnapin], PSArgumentException
+ FullyQualifiedErrorId : AddPSSnapInRead,Microsoft.PowerShell.Commands.AddPSSnapinCommand
[10:00:01] ***********************************************
[10:00:01] * UpdateCas.ps1: 10/26/2014 10:00:01 AM
[10:00:04] Updating OWA/ECP on server DELLR710
[10:00:04] Finding ClientAccess role install path on the filesystem
[10:00:05] Updating OWA to version 14.3.174.1
[10:00:05] Copying files from 'C:\Program Files\Microsoft\Exchange Server\V14\ClientAccess\owa\Current' to 'C:\Program Files\Microsoft\Exchange Server\V14\ClientAccess\owa\14.3.174.1'
[10:00:11] Found 1 OWA virtual directories.
[10:00:11] Updating OWA virtual directories
[10:00:11] Processing virtual directory with metabase path 'IIS://DELLR710.AP.local/W3SVC/1/ROOT/owa'.
[10:00:11] Creating metabase entry IIS://DELLR710.AP.local/W3SVC/1/ROOT/owa/14.3.174.1.
[10:00:11] Configuring metabase entry 'IIS://DELLR710.AP.local/W3SVC/1/ROOT/owa/14.3.174.1'.
[10:00:11] Saving changes to 'IIS://DELLR710.AP.local/W3SVC/1/ROOT/owa/14.3.174.1'
[10:00:11] Saving changes to 'IIS://DELLR710.AP.local/W3SVC/1/ROOT/owa'
[10:00:11] Update OWA done.
[10:00:11] Updating ECP to version 14.3.174.1
[10:00:11] Copying files from 'C:\Program Files\Microsoft\Exchange Server\V14\ClientAccess\ecp\Current' to 'C:\Program Files\Microsoft\Exchange Server\V14\ClientAccess\ecp\14.3.174.1'
[10:00:12] Update ECP done.
Remove-PSSnapin : No Windows PowerShell snap-ins matching the pattern 'Microsoft.Exchange.Management.PowerShell.E2010' were found. Check the pattern and then try the command again.
At C:\Program Files\Microsoft\Exchange Server\V14\bin\UpdateCas.ps1:154 char:16
+ remove-PSSnapin <<<< -Name Microsoft.Exchange.Management.PowerShell.E2010
+ CategoryInfo : InvalidArgument: (Microsoft.Excha…owerShell.E2010:String) [Remove-PSSnapin], PSArgumentException
+ FullyQualifiedErrorId : NoPSSnapInsFound,Microsoft.PowerShell.Commands.RemovePSSnapinCommand

The update removed the E2010 and Support keys from the registry that the EMS was trying to call. Apparently Microsoft doesn’t want you running EMS scripts at the server. Instead we should be running them from a remote workstation. To see which plugins were available I ran the following command:

[PS] C:\Program Files\Microsoft\Exchange Server\V14\Bin>Get-PSSnapin –Registered
Name : Microsoft.Exchange.Management.PowerShell.Setup
PSVersion : 1.0
Description : Setup Tasks for the Exchange Server

Name : Windows.ServerBackup
PSVersion : 2.0
Description : This Windows PowerShell snap-in for Windows Server Backup contains cmdlets used to configure, run, and manage backups.

According to the command only two plugins have been installed. Fortunately the fix is easy – two keys need to be added to the registry. The two plugins that need their information added to the registry are Admin Tasks for the Exchange Server and Support Tasks for the Exchange Server. You can export the keys from a working Exchange server or you can create .reg files using the Pastebins below and merge the files.

Create two registry files by copying and pasting the code from Pastebin and then merge them by right-clicking on each one and selecting Merge. There is no need to reboot or restart Exchange services.
Merging registry packages

Now, when the Powershell script is run it completes without error:

[PS] C:\Program Files\Microsoft\Exchange Server\V14\Bin>UpdateCas.ps1
[10:48:17] ***********************************************
[10:48:17] * UpdateCas.ps1: 10/26/2014 10:48:17 AM
[10:48:17] Updating OWA/ECP on server DELLR710
[10:48:17] Finding ClientAccess role install path on the filesystem
[10:48:17] Updating OWA to version 14.3.174.1
[10:48:17] Copying files from ‘C:\Program Files\Microsoft\Exchange Server\V14\ClientAccess\owa\Current’ to ‘C:\Program Files\Microsoft\Exchange Server\V14\ClientAccess\owa\14.3.174.1’
[10:48:18] Found 1 OWA virtual directories.
[10:48:18] Updating OWA virtual directories
[10:48:18] Processing virtual directory with metabase path ‘IIS://DELLR710.AP.local/W3SVC/1/ROOT/owa’.
[10:48:18] Metabase entry ‘IIS://DELLR710.AP.local/W3SVC/1/ROOT/owa/14.3.174.1’ exists. Removing it.
[10:48:18] Creating metabase entry IIS://DELLR710.AP.local/W3SVC/1/ROOT/owa/14.3.174.1.
[10:48:18] Configuring metabase entry ‘IIS://DELLR710.AP.local/W3SVC/1/ROOT/owa/14.3.174.1’.
[10:48:18] Saving changes to ‘IIS://DELLR710.AP.local/W3SVC/1/ROOT/owa/14.3.174.1’
[10:48:18] Saving changes to ‘IIS://DELLR710.AP.local/W3SVC/1/ROOT/owa’
[10:48:18] Update OWA done.
[10:48:18] Updating ECP to version 14.3.174.1
[10:48:18] Copying files from ‘C:\Program Files\Microsoft\Exchange Server\V14\ClientAccess\ecp\Current’ to ‘C:\Program Files\Microsoft\Exchange Server\V14\ClientAccess\ecp\14.3.174.1’
[10:48:19] Update ECP done.
[PS] C:\Program Files\Microsoft\Exchange Server\V14\Bin>

The following image shows the two new entries for the missing plugins in the registry:
Registry

Registry code for Support Tasks on Pastebin
Registry code for Support Tasks on Pastebin

IIS: Cannot add duplicate collection entry

Running IIS 7.5 (Windows 7) on a development machine when I visit a site I have been working on and get the following error:

What?!? This was working just the other day and I hadn’t changed anything on this site. In fact, this site is just a vanilla WordPress site used for documentation. Other than a child theme there is no coding work done here.

So, I open up IIS and attempt to view the properties for this site and I am greeted with this error:

Ok this helps, there is a problem with the web.config file, having to do with default documents. I remember making a change in IIS recently with default documents. The problem is on line 6 of the web.config file so lets go look at that.

Not much here – were just adding a “index.php” as a default document to this site. Now, I know what is going on. When I setup PHP on this machine I added “index.php” to the list of the default documents for the site I was working on at that time. As I created new sites I added “index.php” as a default document local to the site.

A couple of days ago while adding another site and decided instead of adding “index.php” to the local site’s default documents I would add it to the IIS server’s list of default documents. This would be inherited by all the sites.

There it was I created a situation where the server had a default document of “index.php” and I had a site with a web.config file where I was attempting to add another default document of “index.php” – a duplicate collection entry.

Since, the addition of a default document was the only thing in the web.config the fix was simple – delete the web.config file (I renamed it to test before deleting). After deleting the web.config file IIS was able to display the site’s properties without error:

Viewing the default document properties for the site showed “index.php” was still a default document and it was inherited from the IIS server.

Yes, 4G hotspot works when call received

This is a quick video I made to show that while using the hotspot feature on a Verizon HTC Incredible 4G phone you can still browse the Internet when a phone call is received. We’ve got an employee who is adamant that this is does not work.

Turns out the problem my user had was with an iPhone 5. We’re a Windows shop and he insisted on getting an iPhone.

 

Set Out-of-Office in Exchange using Powershell

The Powershell script below can be used to set the out-of-office auto-reply message for a specific mailbox from a workstation.


# start remote session from workstation
$s = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://MyExchangeServer/PowerShell/ -Authentication Kerberos
Import-PSSession $s

# enable Out of Office reply
$mbox = 'JCDough'
$internal = 'I am currently out of office and unable to return phone calls and emails. Please contact your TAS Specialist and or someone else on the TAS team with any immediate concerns. Thanks!'
$external = 'I am currently out of office and unable to return phone calls and emails. Please contact your account manager with any immediate concerns and we will make sure your taken care of. Thanks!'
Set-MailboxAutoReplyConfiguration $mbox -AutoReplyState enabled -ExternalAudience all -InternalMessage $internal -ExternalMessage $external

# Disable Out of Office reply
$mbox = 'JCDough'
Set-MailboxAutoReplyConfiguration $mbox -AutoReplyState disabled

References:
https://blogs.technet.microsoft.com/samdrey/2013/07/15/exchange-2010-enabling-an-autoreply-message-out-of-office-using-the-exchange-management-shell-powershell/

How to re-enable Recovery Media creation on Lenovo T530

I had to restore a Lenovo T530 laptop running Windows 8 back to Windows 7. I tried to use the recovery media that I put on an SD card but, the laptop couldn’t boot from the SD card. So, I decided I would just recreate the recovery media using DVDs.

I went to another T530 laptop running Windows 7 to create the recovery media but, was presented with the following message:

You can have only one copy of the Microsoft Windows operating system.
The Product Recovery Media Creator will exit now.

Apparently, I had already created recovery media from this machine. Setting aside the stupidity of this tactic or it’s implied meaning (creating recovery media = piracy), I needed to trick this machine into letting me do this.

A quick Google search shows just how common this problem is and fortunately a fix. Unfortunately, many of the results are for older Thinkpads that reference a file that no longer exists. Fortunately, the latest fix was found in this forum post on superuser.com.

To fix, just run this command from a CMD prompt:

echo 0 > Q:\FactoryRecovery\RECOVERY.INI:Done

After running go back into ThinkVantage Tools and retry creating recovery media – it should work.

Fullshot tip: reassign Hotkeys

I have been using Fullshot from Inbit for years and one thing that always got under my skin was not being able to remember the hotkey combination for certain types of captures. It would be really cool if you could hover over the “SWORD” buttons to get a hint with the Hotkey but, you cannot.

However, I have found one way to remember the hotkey combination is to reassign the hotkeys to match the SWORD order for the buttons. In other words 1 = S, 2 = W, 3 = O, and so on. To change the key assignments in Fullshot go to Options > Capture Settings…

Now, all I have to do is count to the letter I want. For example, if I want to capture the Region, I count to the “R” in “SWORD” which is 4. Therefore, the hotkey combination is CTRL+4

Repairing Exchange Discovery Mailboxes

I went to perform a Discovery Search on our Exchange 2010 server for the first time since installing the server. Naturally, there was a problem. When trying to create a search using the Exchange Control Panel (ECP) the response was an error and the search could not be saved. My first thought was to make sure the arbitration accounts were setup and had the correct permissions. So, in the Exchange Management Shell I ran the command get-user -arbitration which showed the system mailboxes were in an inconsistent state:

This fix for this problem is to delete the system accounts and recreate them. The following steps are what I did to recreate the system accounts.

  1. In Active Directory Users and Computers delete the following accounts:
    • FederatedEmail.4c1f4d8b-8179-4148-93bf-00a95fa1e042
    • SystemMailbox{e0dc1c29-89c3-4034-b678-e6c29d823ed9}
    • SystemMailbox{1f05a927-f5af-4646-bf20-4a3a41282c07}
      NOTE: The last account may be different but, should start with “1f05a927”
  2. Open a Command prompt change directory to the setup files for Exchange. On my server this was located in:
    C:\Program Files\Microsoft\Exchange Server\V14\Bin
  3. Run the command: setup.com /preparead. This will recreate the system accounts.
  4. In the Exchange Management Shell run the following commands:
    • Enable-Mailbox –Arbitration –Identity “FederatedEmail.4c1f4d8b-8179-4148-93bf-00a95fa1e042”
    • Enable-Mailbox –Arbitration –Identity “SystemMailbox{e0dc1c29-89c3-4034-b678-e6c29d823ed9}”
    • Enable-Mailbox –Arbitration –Identity “SystemMailbox{1f05a927-f91e-4cc2-b79a-00f3c790c250}”
      Note: last account name will be different. Copy-and-paste name from AD Users and Computers.
  5. Still in the EMS run the following commands to set the display name and quota on the Federated mailbox:
    • Set-Mailbox –Arbitration –Identity “SystemMailbox{e0dc1c29-89c3-4034-b678-e6c29d823ed9}” –DisplayName “Microsoft Exchange”
    • Set-Mailbox –Arbitration –Identity “FederatedEmail.4c1f4d8b-8179-4148-93bf-00a95fa1e042” –ProhibitSendQuota 1MB

After rebuilding the accounts the commands get-user -arbitration and get-mailbox -arbitration should report no errors:

The complete error I was encountering was:

[PS] C:\Program Files\Microsoft\Exchange Server\V14\Scripts>get-user -arbitration
Name RecipientType
—- ————-
SystemMailbox{1f05a927-f5af-4646-bf20-4a3a4128… UserMailbox
WARNING: The object AP.local/Users/SystemMailbox{1f05a927-f5af-4646-bf20-4a3a41282c07} has been
corrupted, and it’s in an inconsistent state. The following validation errors happened:
WARNING: Database is mandatory on UserMailbox.
WARNING: Database is mandatory on UserMailbox.
SystemMailbox{e0dc1c29-89c3-4034-b678-e6c29d82… UserMailbox
WARNING: The object AP.local/Users/SystemMailbox{e0dc1c29-89c3-4034-b678-e6c29d823ed9} has been
corrupted, and it’s in an inconsistent state. The following validation errors happened:
WARNING: Database is mandatory on UserMailbox.
WARNING: Database is mandatory on UserMailbox.
FederatedEmail.4c1f4d8b-8179-4148-93bf-00a95fa… UserMailbox
WARNING: The object AP.local/Users/FederatedEmail.4c1f4d8b-8179-4148-93bf-00a95fa1e042 has been
corrupted, and it’s in an inconsistent state. The following validation errors happened:
WARNING: Database is mandatory on UserMailbox.
WARNING: Database is mandatory on UserMailbox.

Additional Resources:

http://social.technet.microsoft.com/wiki/contents/articles/5317.recreate-and-enable-missing-arbitration-user-accounts-and-mailboxes-in-exchange-server-2010.aspx

Block Google ads in AdBlock Plus

Recently, it has come to light that the developers of the super popular Firefox plugin AdBlock Plus have been taking money by some sites to exempt their ads from being blocked. Probably, the most notable contributor to the plugin developers is Google. The reasons and ramifications have been discussed on several sites like TechCrunch, The Verge, and at Search Engine Watch.

Fortunately, this behavior can be reversed by changing the settings in the AdBlock Plus plugin. The following depicts how:

That’s it! Browsing bliss restored.

It is easy to get angry that such a useful plugin is being eroded due to companies with deep pockets but, we (me and you) have to ask ourselves “how much did we pay for the plugin?” It would not surprise me if in a couple of years the option to block the whitelisted ads will disappear. However, it is my hope that there will be an option to donate to a small amount (5.00 – 10.00 per year) to enable to ability to block whitelisted ads.

 

 

Check php.ini for syntax errors

In the middle of setting-up a new webserver on a Windows Server 2008 machine using IIS7 and PHP 5.4 I ran into a problem that had me stumped for a short time. Though not something that is done frequently setting-up PHP on a Windows server is something that I am well-versed in doing. I know of the most common stumbling blocks and how to get around them – especially on Windows machines.

A common issue for those new to PHP is the php.ini file. Most problems can be attributed to editing the wrong one (albeit a more common problem years ago). This morning I was editing the php.ini on my new server using my normal routine: copy the supplied production version, open the php.ini file on my existing server, and making the new version match as close as possible. The only problem was it appeared the PHP was ignoring the timezone setting in the PHP.

Warning: phpinfo(): It is not safe to rely on the system’s timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone ‘UTC’ for now, but please set date.timezone to select your timezone. in C:\Websites\AP-WWW\pinfo.php on line 2

I was willing to ignore this warning for the time being but, I was also experiencing a problem with MySQL. I was getting the following error: Fatal error: Call to undefined function mysql_connect(). I checked the usual cause – the location of the php.ini file and made sure I was editing the correct file:

I checked the file permissions, folder permissions, rebooted the server, etc. No matter what I did I kept getting the warning that PHP was assuming UTC for the timezone and displayed the lack of a setting for date.timezone in the php.ini file:

The most common cause I could find was to a misspelling of the timezone or using quotes on the line in the php.ini file. This seemed unlikely since I had copied-and-pasted the value from PHP.net’s website and from the php.ini file from my current PHP server.

Fortunately, the source of my frustration was easily identified when I went to compare the information by phpinfo() in a browser to the information displayed in the PHP CLI. From a DOS command window I ran the command php -i which displayed the following error:

When I looked at line 810 of the php.ini file I immediately saw the problem on line 809:

Fixing the error on line 809 and restarting IIS allowed PHP to recognize the timezone setting and eliminated the error connecting to MySQL:

Beware 32bit and 64bit ODBC Data Source Administrators

While creating an SSIS Package in SQL Server 2008 R2 I ran into a problem with an “architecture mismatch between the driver and the application” when trying to use a DSN as a new connection.

It turns out this is the result of the differences between 32-bit and 64-bit drivers. When creating data source names using the ODBC Data Source Administrator (Control Panel > Administrative Tools > Data Sources (ODBC)). Apparently when you run this tool on a Windows 2008 R2 server (64 bit) you are running the 64 bit version of this tool which only recognizes 64 bit drivers. SSIS is expecting 32 bit DSNs using 32 bit drivers (I think – this is still sinking in).

The fix to this is to create 32 bit DSNs. To do this you need to run the ODBC Data Source Administrator located here:

C:\Windows\SysWOW64\odbcad32.exe

One caveat is that you cannot create DSNs with the same name – e.g. “MyReportDB” – in both the 32 bit and 64 bit Data Source Administrator applications. I named mine “MyReportDB_32” and “MyReportDB_64”. I also created shortcuts to both Data Source Administrator applications changing their names to reflect the 32 or 64 bit version.

The 64 bit version of the ODBC Data Source Administrator is located here:

C:\Windows\system32\odbcad32.exe

The following images show the difference of the Drivers tab in the Data Source Administrator applications. This is the 64 bit version of the tool:

And this is the 32-bit version – notice there are alot more drivers:

Hopefully this will save some time for others!

The complete error I was encountering was:

Test connection failed because of an error in initializing provider. ERROR [IM014] [Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Drive and Application

 

Many thanks go John DaCosta for his helpful explanation on his blog!

Create custom wallpaper for your servers

I like to set the Windows Desktop to a specific color to easily identify it from other desktops I may have open. This way when I have multiple Remote Desktops running I can quickly see which one I need to click on. At a minimum I usually set the background color of the Desktop.

Recently though, I started making custom images that I use as wallpaper that incorporate color idea and adds information to positively identify the server I am working on. This information usually includes the host name, IP address, a brief description, and the type of OS running.

I try to make the color the same as the color associated with the primary software installed on  the server. For example, our Prophet21 server is purple since that was their primary color in their logo, orange is used for our Shoretel server, etc. Some servers just have a color that was picked randomly years ago and stuck. Our database server uses olive while our webserver uses teal.

I use Gimp to make the images and put them on the root of the C: drive of the server. Since these are servers themes are usually disabled. To make the image appear as wallpaper I have to open them in Paint and from the File menu select “Set as Wallpaper”. The following are examples of wallpaper for a few of my servers.

This is a screenshot of my Taskbar showing how helpful these wallpapers are:

Cannot login to Windows machine on vmware snapshot

In setting up a new SQL Server 2008 server in VMWare I created a baseline snapshot of the machine as it was before installing SQL Server. This way I could practice installing SQL Server refining the process with each installation.

Today, I reverted back to my baseline snapshot and suddenly could not log in to the server using Remote Desktop. The Widows 7 Remote Desktop client was less than helpful about what could be the cause.

Checking the Event Log on the server only added to the mystery. The server recorded event ID 4625 for a logon failure. According to the log the username and password was not correct but, I know that was not true.

The clue that revealed the actual cause of the problem came from Windows 8! When trying to connect to the server using Remote Desktop on Windows 8 the error was much more specific:

True enough, when I looked down at the time the date and time was way off. The server running in the virtual machine appeared to be using the date of the snapshot’s creation. Being a member of an Active Directory domain I expected the date to be set to the date and time of the domain controller.

Fortunately, you can run DOS command to set the time to the correct time provided by the network time server. The following command resets the time and instructs the server to seek out the network time server:

w32tm /resync /rediscover

Surprisingly, the ancient “net time” command still works and gives you instant feedback:

net time /set

The lesson learned here was to make sure to reset the date and time when going back to a previous snapshot in VMWare.

Transferring logins in SQL Server

I am in the process of upgrading our Prophet21 databases from SQL Server 2000 to SQL Server 2008 R2. After restoring the backup from the old server you are left with a database that has user logins assigned to it that do not exist in the new SQL Server. Furthermore, if you try to just re-create them in SSMS you’ll still have a problem because the “Security Identifiers” or SIDs will be different. You must transfer the logins from the old SQL Server to the new SQL Server.

First, to check for orphaned users in the restored database on the new SQL Server using the stored procedure sp_change_users_login:

This will list all the users in the database that do not exist in SQL Server. To correct this you need to create these users and their SIDs by transferring them from the old SQL Server. There are a few ways to do this but, I found the simplest is to use a modified version of the script Microsoft provides in kb Q918992 that I downloaded from this thread on SQLTeam.com. I ran this script on my old SQL Server.

After running this script I then ran the command (still on the old SQL Server) EXEC sp_help_revlogin which creates, as output, a series of script commands that will create new users when run on the new SQL Server. After running the script output by the stored procedure on the new SQL Server I re-ran the command to check for orphaned users and the result was none being found:

You can download the script I used or get it from the forums. I tweaked it a bit adding a line to check for the existence of the stored procedure it creates since I had run it once already before figuring out what was happening.

Another option for transferring users is to use the transfer logins task within SSIS. Andy Hayes explains how to do this on his blog but, I ran into problems — it appears to only work if the database name is the same on both the old SQL Server and the new SQL Server. I had changed the name of my database during the restore. This may still work but, my knowledge of SSIS is still fairly limited.

Yet another option presented by Shaun Stuart was to use SQL Server 2005 like a swing server — transferring users from 2000 to 2005 and them from 2005 to 2008. Apparently, even when able to use transfer logins task within SSIS going from 2000 to 2008 had problems that were overcome with his technique. You can read about this on his blog.