Solved

remove a odbc system-dsn by script via policy

Posted on 2009-04-11
3
577 Views
Last Modified: 2012-05-06
Hi,
I need some help for a script which removes a odbc system-dsn.
I have a large number of xp-workstations connected to a sql-server in a new 2008 domain.
I would like to remove the old system-dsn in the user-pc's via a script.
Any Ideas?
0
Comment
Question by:michaellandwehr
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 15

Expert Comment

by:Naser Gabaj
ID: 24124622
0
 
LVL 8

Accepted Solution

by:
stehardy88 earned 500 total points
ID: 24678869
Hi michael,

Use the attached script, but change ##ODBC NAME## to the name you've given the ODBC connection.

Cheers,

stehardy88

Const HKEY_LOCAL_MACHINE = &H80000002
 
strComputer = "."
 
Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _ 
    strComputer & "\root\default:StdRegProv")
 
strKeyPath = "SOFTWARE\ODBC\ODBC.INI\##ODBC NAME##"
objReg.DeleteKey HKEY_LOCAL_MACHINE, strKeyPath
 
strKeyPath = "SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources"
strValueName = "##ODBC NAME##"
objReg.DeleteValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName

Open in new window

0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Data center, now-a-days, is referred as the home of all the advanced technologies. In-fact, most of the businesses are now establishing their entire organizational structure around the IT capabilities.
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question