?
Solved

remove a odbc system-dsn by script via policy

Posted on 2009-04-11
3
Medium Priority
?
579 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 8

Accepted Solution

by:
stehardy88 earned 2000 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

WordPress Tutorial 4: Recommended Plugins

Now that you have WordPress installed, understand the interface, and know how to install new parts, let’s take a look at our recommended plugins.

Question has a verified solution.

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

A small collection of useful tips and tricks for Windows 10 users that I decided to write as a result of recent questions that were asked and answered at Experts Exchange. Two short video tutorials included. Enjoy..
Ever visit a website where you spotted a really cool looking Font, yet couldn't figure out which font family it belonged to, or how to get a copy of it for your own use? This article explains the process of doing exactly that, as well as showing how…
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…
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…
Suggested Courses

762 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