Error 0x80070005 when using SWbemLocator.ConnectServer to initiate a WMI session despite using the correct username and password

System Requirements:

  • WMI 1.5 or higher
  • Windows 95, 98, 98SE, Millennium
  • Windows NT 4.0, 2000, XP, 2003, Vista, 2008, 7

The Problem:

When using WMI’s SWbemLocator.ConnectServer class to log onto a remote system, you receive an 0x80070005 access denied error (Decimal -2147024891).

This error occurs even though the username and password are correct and the account credentials are synchronised properly between the local and remote machine – either by domain or manually in a workgroup.

More Info

The classfull connection line for using SWbemLocator is:

Set objWMIService = objSWbemLocator.ConnectServer(<computerName>, <wmiDefaultClassPath>, <username>, <password>)

for example:

Set objWMIService = objSWbemLocator.ConnectServer("192.168.0.100", "root\cimv2", "Administrator", "12345abcde")

The Fix

There is a very good chance that the problem you are having is to do with the username you are entering. You need to ensure that you are prefixing the username with the logon domain.

For example if your domain is camie.local your username should be camie\Administrator

Set objWMIService = objSWbemLocator.ConnectServer("192.168.0.100", "root\cimv2", "camie\Administrator", "12345abcde")

But I’m using a workgroup!

Don’t worry, you can do one of three things.

  1. Prefix the remote machine name (the local logon domain)
  2. Prefix the workgroup
  3. Send a null logon domain
Set objWMIService = objSWbemLocator.ConnectServer("192.168.0.100", "root\cimv2", "myHostName\Administrator", "12345abcde")

Set objWMIService = objSWbemLocator.ConnectServer("192.168.0.100", "root\cimv2", "workgroup\Administrator", "12345abcde")

Set objWMIService = objSWbemLocator.ConnectServer("192.168.0.100", "root\cimv2", "\Administrator", "12345abcde")

Using one of the above, you should be able to connect to the remote workstation. If you are dealing with a mix of workgroups or cannot know the hostname in advance I suggest using \<username> with I have tested to work on Windows 95 right through to Windows 7.

Uninstalled WD SES Device USB Device appears in device manager with Western Digital Passport ‘Smartware’ enabled device

System Requirements:

  • Western Digital Smartware enabled USB device

The Problem:

When you install a Western Digital USB hard drive an uninstalled device appears in “other devices” in the Windows device manager.

More Info

The WD SES Device USB Device is a enclosure communication and feedback device which, when enabled allows the USB enclosure to communicate additional metrics about the state of the equipment. In this case, the USB enclosure is the USB Caddy containing the 2.5″ drive.

SES stands for SCSI Enclosure Services, which provide extensions to the SCSI command set to allow for reporting and querying of data such as power consumption and state and cooling performance and thermal state within the caddy. The commands are used for diagnostic purposes and are not required in the functionality of the drive or data I/O itself.

You can continue to use the drive without this driver installed. In the case of Western Digital, its main purpose is to facilitate value added features in the Smartware management software.

The Fix

You can find the driver on the 614MB UDF partition that appears with the data storage volume in My Computer. Point the driver installation Wizard at the UDF partition, or more specifically to X:\Extras\WD SES Device Driver where X: is the mounted driver letter for the UDF partition labeled “WD SmartWare”.

The WD SES Driver version shipping with drives containing WD Smartware 1.2.0.8 and with the update (3.1.0.13) available from wdc.com is version 1.0.7.2. It is available for both x86 and x64 systems.

Microsoft JET Database Engine error ‘80040e21’ – Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.

System Requirements:

  • Windows NT 4.0
  • Windows 2000
  • Windows XP
  • Windows Server 2003
  • Windows Vista
  • Windows Server 2008
  • Windows 7

The Problem:

When you attempt to connect to a Microsoft Access database using the ODBC provider Microsoft.Jet.OLEDB.4.0 you receive the error message:

Microsoft JET Database Engine error ‘80040e21’
Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done./path/file.asp, line ##

 

More Information:

There are a number of issues that can cause this error, they are poorly documented elsewhere online but the information is there; connection string, registry values slightly offset and so fourth. This document deals with one specific issue which is related to the idea of this being caused by an incompatible type value.

The chances of you running into this are quite extreme, however it is an issue in JET (Microsoft Access) that doesn’t exist in Microsoft SQL Server and thus if you are dealing with code transitioning you may want to know about the problem in this very extreme and unlikely situation.

You shouldn’t need to reboot to solve the problem, it didn’t in my case. However, if nothing happens do restart before progressing to the next step.

SQL Example

The following SQL Statement will execute on Microsoft SQL Server and return a RecordSet however the same SQL on JET 4.0 will result in the error message outlined above.

SELECT
Student.StudentID,
Student.FirstName,
Student.LastName,
Student.EMail,
null AS studentPhotoBLOB,
Left(StudentID,1) AS YearPrefix
FROM Student;

No, it isn’t the T-SQL LEFT() statement that is the problem. The issue lies in the “null AS studentPhotoBLOB”.

The idea behind this is that space has been reserved in the record set. Why would you want to do this? If you want to drop the record set directly into an array, then ADO can do this for you using the GetRecords method. However if you want to change the structure you have to re-parse the array and relocate the data into a new structure. You can inset a null named record and use the space in the GetRecords array later for other purposes.

The problem here is that null is not a data type that is supported by JET; it is supported by Microsoft SQL Server however.

The simplest way to remedy the situation is to either change the SQL or dynamically detect JET to change the variable type to a commonly supported data type, for example a String.

SELECT
Student.StudentID,
Student.FirstName,
Student.LastName,
Student.EMail,
” AS studentPhotoBLOB,
Left(StudentID,1) AS YearPrefix
FROM Student;

This is naughty, however in a weak typed language such as ASP it isn’t a real problem given the situation outlined above. The use of ” instead of null forces the data type of the column into a string and thus it can be parsed by JET.

Warning: Asus P4C800-E Deluxe and using modern Power Supply Units (PSU) with a motherboard earlier than 2005/2006 (Intel Socket 478)

System Requirements:

  • Old motherboard (specifically in my case a Intel Socket 478 motherboard)
  • Asus P4C800-E

The Problem:

So you have a trusty old 478 system that you cant bare to part with, but the PSU has just blow out on it and you need a new one. You know that a good PSU is worth the investment, you get a brand name, a high wattage value and something with a high efficiency value.

You get home, you wire it up and… nothing.

The machine turns on, it may post, it may just hold up on a black screen before the POST. The latter is what happened with my Asus P4C800-E Deluxe when I came to replace the PSU with a £70 Antec TruePower PT-550. It would not start, however if I swapped back a cheap PSU that I borrowed as a stop gap, it would POST fine.

More Information:

Another 15 mile one way trip back to the store with the Antec and we stood around scratching our heads over this one for a few minutes.

It turns out that all (decent) modern PSU’s have a design change which makes them incompatible with boards that require -5v – and probably quite a few others.

The Asus P4C800-E Deluxe requires a -5v rail on the ATX in order to get going. In every brand name PSU box we opened in the store – including the one I was returning – the -5v rain pin was missing from the 20-pin ATX connector.

Net result: the system cannot boot.

Why are PSU’s shipping without this?

Some post-event research leads me to understand that with the release of the ATX12V specification version 1.2 in January 2002, the -5v rail became optional on the ATX specification. With revision 1.3 in April 2003 and the 2.x revision the -5v rail was banned altogether. Look at any modern PSU and you’ll find that pin 20 in the ATX connector is blanked out.

So if you are looking for a decent PSU for a Intel 478 system, you may have a problem. In the end I was forced to get one of those cheap PSU’s that case manufacturers supply with cases – which conveniently has a -5v rail but is unremarkable in every other way aside from probably its inefficiency.