Group Policy Preferences and ODBC configuration

Okay, there recently was a conversation about Group Policy Preferences and other user’s experiences in the newsgroups. One of the folks who responded to the thread wrote that there was a bug with the ODBC configuration mechanism. It basically would throw an error when you’re trying to configure a ODBC connection using SQL Auth.

If you’re one of those guys having trouble with the ODBC connections, read Mark Heitbrink’s solution on how to successfully create an ODBC connection: http://groups.google.com/group/microsoft.public.windows.group_policy/browse_thread/thread/c4145644429870/f80f9aff4e472618?lnk=st

I’m going to paste the solution down here:

(…) The easiest way to go:
- create an ODBC connection manually in the admnistrative tools
- on this system, where you configured succesfully the connection
  open GPMC and the GPEditor
- GPP -> Datasource -> create a new one.
- If you use the browse button on databasename (DSN) you can choose
  the manually created one

We now have the idea, that it should work perfectly, but it does not :-(
Some more steps to do:

- drag´n´drop the configuration to your desktop, so that you can
  edit the XML File
- after d´n´d, delete the entry in GPP
- edit the XML an delete -> username=”" cpassword=”" from configuration,
  because these “empty/wrong” flags are giving the “data sources
  0×80070057″ error. The problem is, because of the not scriptable
  password in MS SQL Driver. Acces/MySQL whatever will work :-)

Sample XML prior editing:
— MyDatabaseConnection.xml —
<?xml version=”1.0″ encoding=”utf-8″?>
<DataSource clsid=”{5C209626-D820-4d69-8D50-1FACD6214488}”
name=”MyDatabaseConnect” image=”2″ changed=”2008-08-14 09:20:16″
uid=”{89CD5CC2-6C10-4A0F-83E7-AFB3BBA1064A}” userContext=”0″
removePolicy=”0″><Properties action=”U” userDSN=”0″ dsn=”MyDatabaseConnect”
driver=”SQL Server” description=”none” username=”"
cpassword=”"><Attributes><Attribute name=”SERVER”
value=”DBServer-01″/><Attribute name=”DATABASE”
value=”NameOfDatabase”/><Attribute name=”TRUSTED_CONNECTION”
value=”Yes”/></Attributes></Properties></DataSource>
— MyDatabaseConnection.xml —

After editing:
— MyDatabaseConnection.xml —
<?xml version=”1.0″ encoding=”utf-8″?>
<DataSource clsid=”{5C209626-D820-4d69-8D50-1FACD6214488}”
name=”MyDatabaseConnect” image=”2″ changed=”2008-08-14 09:20:16″
uid=”{89CD5CC2-6C10-4A0F-83E7-AFB3BBA1064A}” userContext=”0″
removePolicy=”0″><Properties action=”U” userDSN=”0″ dsn=”MyDatabaseConnect”
driver=”SQL Server” description=”none”><Attributes><Attribute name=”SERVER”
value=”DBServer-01″/><Attribute name=”DATABASE”
value=”NameOfDatabase”/><Attribute name=”TRUSTED_CONNECTION”
value=”Yes”/></Attributes></Properties></DataSource>
— MyDatabaseConnection.xml —

- d´n´d the XML into your blank config of Data Sources in GPEditor

DO NOT TOUCH THE SETTING INSIDE THE GUI ANYMORE!
Or if you do, delete username=”" cpassword=”" again. If you open the
setting, the deleted entries will be written again and causing the
error again.

1 Comment so far

  1. [...] a known bug with GPP and ODBC. Here’s a blog post that explains it along with a fix: Florian’s Blog Group Policy Preferences and ODBC configuration . [...]