# ODBC connection through DSC

**URL:** <https://forums.powershell.org/t/odbc-connection-through-dsc/8471>\
**Category:** DSC\
**Created:** [April 20, 2017, 12:58pm UTC](https://forums.powershell.org/t/odbc-connection-through-dsc/8471 "2017-04-20T12:58:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![obietall](https://avatars.discourse-cdn.com/v4/letter/o/a698b9/32.png) [@obietall](https://forums.powershell.org/u/obietall)\
**Post date:** [April 20, 2017, 12:58pm UTC](https://forums.powershell.org/t/odbc-connection-through-dsc/8471/1 "2017-04-20T12:58:12Z")

</div>

I’ve got an application that I run an powershell command(add-odbcdsn) as part of its install. Does anyone know of a DSC resource that could assist me with running that command?

---

<div class="post-metadata">

**Author:** ![donj](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/donj/32/137_2.png) [@donj](https://forums.powershell.org/u/donj)\
**Post date:** [April 20, 2017, 1:56pm UTC](https://forums.powershell.org/t/odbc-connection-through-dsc/8471/2 "2017-04-20T13:56:31Z")

</div>

Nope. You’d have to do something custom, either a Script resource or a full resource. But you have to write the full Test portion to determine if your command NEEDS to be run or not.

---

<div class="post-metadata">

**Author:** ![david-jones1](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/david-jones1/32/90_2.png) [@david-jones1](https://forums.powershell.org/u/david-jones1)\
**Post date:** [April 20, 2017, 2:40pm UTC](https://forums.powershell.org/t/odbc-connection-through-dsc/8471/3 "2017-04-20T14:40:39Z")

</div>

ODBC entries are just registry entries under HKLM\Software\ODSB\ODBC.INI\ you could just use the registry resource

---

<div class="post-metadata">

**Author:** ![obietall](https://avatars.discourse-cdn.com/v4/letter/o/a698b9/32.png) [@obietall](https://forums.powershell.org/u/obietall)\
**Post date:** [April 20, 2017, 6:16pm UTC](https://forums.powershell.org/t/odbc-connection-through-dsc/8471/4 "2017-04-20T18:16:03Z")

</div>

Thanks for the info Dave. I actually exported the .reg and use cRegFile Dsc resource to import it in.

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 9:16pm UTC](https://forums.powershell.org/t/odbc-connection-through-dsc/8471/5 "2024-05-16T21:16:45Z")

</div>

Closed on May 16, 2024, 9:16pm UTC


