Sunday, July 16, 2006

Setting MP3 ID Tags with CDDBControl.dll

The CDDBControl DLL that can be downloaded from here can be used in VB or Java Script to programatically set and read the ID3 tags on an MP3 file. Lots of documentation exists on Google which shows you how to write the script, but today I discovered that this control will only operate if the user calling it has Administrator privileges.

Using tools from Sysinternals did not give me any additional information on why this restriction was true (as the file I was changing had got full control for the limited user that runs the script) so I added the DLL to Component Services as described below to solve the problem.

  1. Create a new user account with administrative permissions on the local machine. Give this account a very complex password and require that the password never expires.
  2. Login as this account and start Component Services (in the Administrative Tools area of Control Panel)
  3. Expand the Component Services tree until you get to COM+ Applications and right-click this node of the tree
  4. Choose New Application, Create an empty application and provide a name such as ID3Tag for the application. Keep the default of Server Application set.
  5. On the Set Application Identity page choose This User and enter the details for the current user account. It is important that you select this option and do not leave the default value of Interactive User set.
  6. Once the component is created, right-click the component and select the Pooling & Recycling tab. Set 1 minute for the Expiration Timeout value (unless your script takes longer to run) and click OK.
  7. Expand Component Services so that the contents of Components under your component are visible (this area will currently be empty)
  8. If you have already registered the control with regsvr32 then you need to unregister it using regsvr32 -u "path\CDDBControl.dll"
  9. Find the folder in which you have copied CDDBControl.dll and drag the dll into the Components container in Component Services
  10. You will get an error about some components not being able to be installed. You can click OK at this point.

You can now run your script as a limited user and when you call the id3.SaveToFile function the script will not fail with error 0x82fc100c

Saturday, May 06, 2006

Virtual PC's Crashing With IntelPPM.sys and Processor.sys

Today I booted a virtual machine that was provided for me by a client so that I could prep a training course, but I could not log into the virtual machine because it blue-screened with a driver called intelppm.sys failing (and supposedly processr.sys can cause the same problem, but I have not experienced that one yet). Note that the virtual machine might just reboot rather than blue-screen because that is what it is configured to do.

The blue-screen is due to the virtual machine running on an AMD K8 or Centrino platform and the above device driver attempting a unsupported command that was supported on the platform that the virtual machine was originally created under. You can disable these drivers without issue in the virtual machine - just you cannot login to disable them!

So you need to use Safe Mode. Press the F8 key repeatedly as the virtual machine boots and then choose Safe Mode from the on-screen menu. Once you have logged in run these two commands from a command prompt (note that where the spaces are is important):

sc config processor start= disabled
sc config intelppm start= disabled

You should get a SUCCESS message returned. Once you do you can shutdown the virtual machine (and commit changes if you are have undo disks enabled) and then start the machine up normally.

This problem has been fixed under Virtual Server 2005 R2, but is still an issue with Virtual PC 2004 and Virtual Server 2005.

Thursday, February 23, 2006

Adding Routes Using CMAK

I have just put together a Connection Manager VPN client (CMAK) and within it have specified the extra routing information that I needed. When I ran the client I got the following error message and could not find anything on the web with an answer, so here is the answer...

Error 1: Connect action to update your routing table failed (80070057) - shown in the VPN client

Error 2: ErrorCode = -2147024809 ErrorSource = to update your routing table - recorded in the VPN log file

The reason! It was because I had entered an incorrect routing record in the text file. So to get this right, add the routes manually when connected and make sure they work, and then duplicate these entries in the text file. If the routes cannot be added on the command line then the VPN connection will fail with the above error message.

Monday, February 13, 2006

P1 and P2 Headers in SMTP

P1 = the value on the MAIL FROM command of the SMTP connection (the message envelope) as defined in RFC 821.
P2 = the email address in the message body as defined in RFC 822. These include the FROM, REPLY TO and SENDER fields

For example, the following SMTP command sequence describes where P1 and P2 are used:

HELO server
MAIL FROM this_is@my_p1_address.com
RCPT TO: recipient@domain.com
DATA
FROM: this_is@my_p2_address.com
TO: recipient@domain.com
SUBJECT: This is a blog on P1 and P2

This is the text of the message
.

The MAIL FROM value should be your email address, but it does not have to be (ie one of the reasons why spam is so prevalent)
The FROM: header should match this, but this value is what is displayed in the email in Outlook (and other clients). The P1 address is used for routing and not display.

If the connection to an Exchange Server is anonymous then the P2 address will contain the display name and the email address, but if it is an authenticated connection then the P2 email address will be resolved to the value in the address book and this value will be displayed.

Thursday, February 02, 2006

Invalid Visibility When Sending Email in Microsoft CRM

Having recently installed Microsoft Dynamics CRM 3.0 I found that when I wanted to send an email to a contact in the system it failed with the error message "Invalid Visibility".

This error occurs because the code that sends the email does not complete successfully, and in my case because of anti-spam restrictions enabled on the Exchange Server that was being used as the SMTP gateway. The Exchange Server is the organisations only SMTP server, and the corporate firewall allows SMTP inbound and outbound only from this machine. Therefore this Exchange Server has a series of global message filters enabled which where activated on the SMTP virtual server on this machine. One of these anti-spam settings was to reject any mail on the SMTP virtual server that was from the domain name of the company and not authenticated. This stops lots of spam from outside the network that poses as if it where from inside the network, but as the CRM SMTP session was not authenticated, it too fell into this category.

So when CRM tried to send email, it received behind the scenes a 550 error - Sender Denied and so it generated the Invalid Visibility message.

Therefore, in this case, the fix was to authenticate the session, but alternatives exist such as providing a dedicated SMTP virtual server for the CRM application and additional routes outbound through the firewall for SMTP.

In addition to the above, the same error can be caused by other SMTP failures, so if you are getting the same error then open a command prompt on the CRM server and enter the following commands, waiting for an error and then using this to diagnose the reason why CRM 3.0 will not send emails for you (if anonymous email is allowed).

  TELNET smtp_server_name 25
  HELO crm_server_name
  MAIL FROM: email_address@yourdomain
  RCPT TO: recipient@externaldomain
  DATA
  TO: email_address@yourdomain
  FROM: recipient@externaldomain
  SUBJECT: CRM Test
blank line needed here
  Some text to act as the body of the message
  .
Always finish the email with a full-stop on a line on its own